Different styles for the anchor tag when clearing the browser cache

when I click on the anchor tag, a dotted frame goes around my anchor text. it goes in IE7, IE8 and firefox. I used.

a{ outline:none; }

this works as expected. But I need to clear my browser cache. If and until I clear the cache in my browser, a dashed line will appear around my anchor part.

Can someone please tell me why I should always clear the cache every time in order to do the work with the content. Is there any solution that does not clear the cache that the dashed line disappears.

+4
source share
5 answers

Perhaps you need to add a pseudo-class to your CSS:

 a:visited { outline: none; } 

The a:visited style must inherit from the a class, but some older browsers, such as IE6, do not follow this rule ( Source ). To ensure proper style compatibility with older browsers, it is recommended that you define the a:visited pseudo-class.

+1
source

try using reset CSS like this

+1
source

The best way to get rid of this is to use a:visited and / or a:active , for example, like Daniel Vassallo.

This should fix the problem and still provide visual feedback to users who navigate through all elements using TAB.

0
source

I used..

a: link, a: visited, a: hover, a: active {scheme: no! important; -moz-contour: no; }

but I still need to clear the cache every time for it to work.

0
source

Perhaps you are redefining a:visited rule. For example, if you have more than one style sheet, for example:

 <link rel="stylesheet" href="css/style-a.css"> <link rel="stylesheet" href="css/style-b.css"> 

In style-a.css, we found the following rule:

 a:visited { color: #00ff00; } 

And, on style-b.css we have:

 a:visited { color: #ff0000; } 

As a result, the visited link will be colored in red (# ff0000), the rule found on style-b.css , and NOT Green (# ff0000), as shown in style-a.css

For reference:

A cascade of CSS assigns weight to each style rule. When several rules apply, the one with the highest weight takes precedence. - http://www.w3.org/TR/CSS2/cascade.html#cascade

0
source

Source: https://habr.com/ru/post/1300604/


All Articles