清除浏览器缓存时锚标记的不同样式
当我单击锚标记时 - 我的锚文本周围出现一个虚线边框。该功能将在 IE7、IE8 和 Firefox 中推出。我用过。
a{ 大纲:无; }
这按预期工作。但是我需要清除浏览器的缓存。除非并且直到我不清除浏览器中的缓存,锚文本周围才会出现虚线。
有人可以告诉我为什么我每次都需要清除缓存才能使大纲属性正常工作。有没有什么解决方案可以在不清除缓存的情况下虚线消失。
when i click on anchor tag - a dotted border come around my anchor text. the is is coming in IE7,IE8 and firefox. I have used.
a{ outline:none; }
this works as expected.But i need to clear the cache of my browser. Unless and until i don't clear the cache in my browser that dotted line appears around my anchor text.
Could anybody please tell me why always I am required to clear cache everytime to make outline property work. Is there any solution that without clearing the cache that dotted line will disappear.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
尝试使用重置 CSS,例如 this
try using a reset CSS like this
您可能需要在 CSS 中添加
a:visited
伪类:a:visited
样式应继承自a
类,但一些较旧的浏览器(例如 IE6)不遵循此规则(来源)。为了确保与旧版浏览器的正确样式兼容性,建议定义a:visited
伪类。You may need to add the
a:visited
pseudo-class to in your CSS:The
a:visited
style should inherit from thea
class, but some older browsers like IE6 do not follow this rule (Source). To ensure correct style compatibility with older browsers, it is recommended to define thea:visited
pseudo-class.摆脱这个问题的最好方法是使用
a:visited
和/或a:active
,就像 Daniel Vassallo 回答的那样。这应该可以解决问题,并且仍然为使用 TAB 浏览所有元素的用户提供视觉反馈。
The best way to get rid of this is to use
a:visited
and/ora:active
like Daniel Vassallo anwered.This should fix the problem and still gives visual feedback to users who navigate through all elements with TAB.
我用过..
我仍然需要每次清除缓存才能使其正常工作。
i have used..
but still i need to clear cache everytime to make it working.
您可能会覆盖
a:visited
规则。例如,如果您有多个这样的样式表:在 style-a.css 上,我们发现以下规则:
并且,在 style-b.css 上,我们有:
结果访问的链接将被着色为红色 (#ff0000) 该规则在
style-b.css
上找到,而不是在style-a.css
上找到的绿色 (#ff0000)供参考:
You are probably overriding the
a:visited
rule. For example if you have more than one style sheet like this:On style-a.css we found the following rule:
And, on style-b.css we have:
The resulting visited link will be colored Red (#ff0000) the rule found on
style-b.css
, and NOT Green (#ff0000) as found onstyle-a.css
For reference: