gpt4 book ai didi

css mouseover - 在 FF 中有效但在 IE 中无效

转载 作者:行者123 更新时间:2023-11-28 11:49:26 26 4
gpt4 key购买 nike

我有以下 css,当我在 Firefox 中将鼠标悬停在它上面时可以工作,但在 IE(6) 中不能。

.PageMenu{
list-style: none;
list-style-type: none;
padding: 0;
margin: 0;
display: inline;
list-style-position:outside;
}

.PageMenu li{

display: block;
padding: 0;
margin: 0;
line-height: 20px;
font-weight: bold;
border-bottom: 1px solid #ccc;

}

ul#PageMenu li:hover {
color: #000;
background-color: #ddd;
}

HTML 是:

<ul class="PageMenu" id="PageMenu">
<li>
<a title="test" class="getPage">Click this link</a>
</li>
<li>
<a title="test" href="#" class="getPage">Link text</a>
</li>
</ul>

我正在寻找一个可以在 IE(特别是 6)和 Firefox 中工作的 css 解决方案。

最佳答案

您不能分配 :hover除了<a>之外的任何规则IE6 中的元素。尝试

ul#PageMenu a:hover {
color: #000;
background-color: #ddd;
}


ul#PageMenu a {
display: block;
width:100%;
}

关于css mouseover - 在 FF 中有效但在 IE 中无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6491367/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com