我是一个编程新手,一直在学习。我想有人向我解释如何我可以交换这些图像的例子文本https://media.discordapp.net/attachments/748951699950927913/1092194621859319870/image.png来https://media.discordapp.net/attachments/748951699950927913/1092195435831120002/image.png
我正在测试这些图像:
/* Grupos */
.qeel_groupes a {
color: #ffffff;
display: block;
font-weight: 700;
margin: .8rem 0;
padding: .5rem 0;
text-align: center;
text-transform: uppercase;
transition: .5s all;
border-radius: 5px;
}
.qeel_groupes a:hover {
color: #FFFFFF !important;
}
a#q_basic {background: #000000;}
a#q_magic {background: #ad3737;}
a#q_wizard {background: #3e3b96;}
<div class="qeel_bloc">
<div class="qeel_dernier">
{NEWEST_USER}
</div>
<div class="qeel_groupes">
<a href="g2-narradores" id="q_basic">
Narradores
</a>
<a href="g3-pirata" id="q_magic">
Piratas
</a>
<a href="g4-marinha" id="q_wizard">
Marinheiros
</a>
</div>
</div>
我尝试将文本替换为a,但它不起作用。我很抱歉,我真的在学习,如果有人可以解释我
您需要使用<img>
元素插入图像,或者使用CSS更改其他元素的background-image
。
在本例中,background-image
应用于锚定元素。
a#q_basic {
background-image: url(https://cdn.sstatic.net/Img/unified/sprites.svg);
text-indent: -9999em;
display: inline-block;
width: 188px;
height: 50px;
}
a#q_magic {
background-image: url(https://cdn.sstatic.net/Img/unified/sprites.svg);
text-indent: -9999em;
display: inline-block;
width: 188px;
height: 50px;
}
a#q_wizard {
background-image: url(https://cdn.sstatic.net/Img/unified/sprites.svg);
text-indent: -9999em;
display: inline-block;
width: 188px;
height: 50px;
}
<div class="qeel_bloc">
<div class="qeel_dernier">
{NEWEST_USER}
</div>
<div class="qeel_groupes">
<a href="g2-narradores" id="q_basic">
Narradores
</a>
<a href="g3-pirata" id="q_magic">
Piratas
</a>
<a href="g4-marinha" id="q_wizard">
Marinheiros
</a>
</div>
</div>