将鼠标悬停在“a”标签上(IE 无法正常工作)
Posted
技术标签:
【中文标题】将鼠标悬停在“a”标签上(IE 无法正常工作)【英文标题】:hover on 'a' tags (IE not working properly) 【发布时间】:2012-07-15 00:19:37 【问题描述】:我们有一个带有a
标签的div
。在css
中定义了hover
样式。除 IE 外,一切正常。
请打开demo(在IE中),并尝试随着时间在div
之间移动鼠标。如您所见,第一个 div
改变了颜色。我该如何修复这个错误?
【问题讨论】:
Bug 在 IE8 中可重现。看我的回答。 【参考方案1】:删除display: table;
并替换为#kassa_cont_space .sean_box .details .sched
中的overflow: hidden;
,这是CSS 中的最后一个样式。
#kassa_cont_space .sean_box .details .sched
padding: 0px 15px 15px 15px;
overflow: hidden;
工作 JSFiddle:http://jsfiddle.net/BqjSa/4/
【讨论】:
【参考方案2】:更改这部分代码...
<div class="sched">
<a href="javascript:void(0);" class="link _001" style = "display:block;"><span class="time">10:30</span><span class="cost">от 700 тг</span></a>
<a href="javascript:void(0);" class="link _001"><span class="time">10:30</span><span class="cost">от 700 тг</span></a>
<a href="javascript:void(0);" class="link _001"><span class="time">10:30</span><span class="cost">от 700 тг</span></a>
<a href="javascript:void(0);" class="link _001"><span class="time">10:30</span><span class="cost">от 700 тг</span></a>
<a href="javascript:void(0);" class="link _001"><span class="time">10:30</span><span class="cost">от 700 тг</span></a>
<a href="javascript:void(0);" class="link _001"><span class="time">10:30</span><span class="cost">от 700 тг</span></a>
</div>
..到这个..
<div class="sched">
<div style="float:left; margin:0;padding:0">
<a href="javascript:void(0);" class="link _001" style = "display:block;"><span class="time">10:30</span><span class="cost">от 700 тг</span></a>
</div>
<div style="float:left; margin:0;padding:0">
<a href="javascript:void(0);" class="link _001" style = "display:block;"><span class="time">10:30</span><span class="cost">от 700 тг</span></a>
</div><div style="float:left; margin:0;padding:0">
<a href="javascript:void(0);" class="link _001" style = "display:block;"><span class="time">10:30</span><span class="cost">от 700 тг</span></a>
</div><div style="float:left; margin:0;padding:0">
<a href="javascript:void(0);" class="link _001" style = "display:block;"><span class="time">10:30</span><span class="cost">от 700 тг</span></a>
</div><div style="float:left; margin:0;padding:0">
<a href="javascript:void(0);" class="link _001" style = "display:block;"><span class="time">10:30</span><span class="cost">от 700 тг</span></a>
</div>
</div>
这将解决您的问题...
或者只是从 "#kassa_cont_space .sean_box .details .sched" css 中删除 "display:table"
【讨论】:
以上是关于将鼠标悬停在“a”标签上(IE 无法正常工作)的主要内容,如果未能解决你的问题,请参考以下文章