所以这里是链接,当我没有悬停在它上面。通过背景颜色在文字上显示背景颜色
我试着仰视怎么过让文字透明的,这样就可以看到图像的通过文字的背景,也没有找到这事。这是我将鼠标悬停在链接上时的样子。
下面是DIV的代码,我在做这个。
#learnmore{
padding: 10px;
margin: 10px;
border: 2px solid white;
color: white;
}
#learnmore:link{
padding: 10px;
border: 2px solid white;
color: white;
}
#learnmore:visited{
padding: 10px;
border: 2px solid white;
color: white;
}
#learnmore:hover{
background: white;
color: transparent;
}
#learnmore:active{
padding: 10px;
border: 2px solid white;
color: white;
}
<div id="offer">
<img src="imgs/detroit.jpeg" title="" alt="">
<h1>Offer Header</h1>
<p>Here is a little bit of information about our offer.</p>
<a href="" id="learnmore">Learn More</a>
<a href="" id="scrolldown"><img src="imgs/down arrow.png"></a>
</div>
有谁知道这是可能的吗?
应该'#learnmore:hover { background:white; 颜色:透明; }'be' #learnmore:hover { background:transparent; 颜色:透明; }'?为什么要将悬停背景设置为白色? – gabe3886
试试这个#learnmore:hover {background:none; color:#fff;} –
@ gabe3886我认为op想要一个“雕刻出来”的文字效果,文字是透明的,并且会采用标题背景的颜色。 –