那:hover
是行不通的,我也不知道为什么。
您应该知道,我已经将原始代码缩减为以下几行。但是它们每个都像“内容” div一样有用。
如果我删除了width:100%;
或者行position:fixed;
了,但是我不知道为什么(我无法删除这些行,因为我在原始网站中使用了它们)
#content {
height: 100%;
width: 100%;
position: fixed;
left: 0;
top: 0;
}
a {
width: 100%;
}
a:hover {
font-size: 23pt;
}
<a>HOME</a>
<div id="content">
</div>
所述#content
格被取出正常DOM绘画流的由于position:fixed
和变成定位在锚定标签的顶部。
解决此问题的一种简单方法是z-index
对内容设置否定。
#content {
height: 100%;
width: 100%;
position: fixed;
left: 0;
top: 0;
z-index:-1;
}
a {
width: 100%;
}
a:hover {
font-size: 23pt;
}
<a>HOME</a>
<div id="content">
</div>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句