这就是我所拥有的
主页上带有背景图像的 Main Div 内的四个按钮。
我想要达到的目标
在每个按钮悬停时,我只想使用CSS
.
我可以在HTML
某种程度上进行标记。
下面是原型
我的 HTML
<div id="mainImage"><img class="style1" width="100%" height="100%" /></div>
<div id="DwellRestBtn"><a href="Dwell & Rest.html">Four</a></div>
<div id="DwellRestBtn"><a href="Dwell & Rest.html">Three</a></div>
<div id="DwellRestBtn"><a href="Dwell & Rest.html">Two</a></div>
<div id="DwellRestBtn"><a href="Dwell & Rest.html">One</a></div>
我的 CSS
.style1
{
width:500px;
height:500px;
}
.style1
{
content:url('http://www.audenaerde.org/tiger.jpg');
}
a:hover .style1
{
content:url('http://www.butterflypictures.net/images/morpho-butterfly.jpg');
}
如果有方法,css3
它应该至少与现代浏览器兼容。