HTML default link color

前端 未结 3 477
花落未央
花落未央 2021-01-18 06:42

I want to set color of some elements to default link color with CSS.

That color is the same as 

        
相关标签:
3条回答
  • 2021-01-18 07:25

    after some time messing around with testing pure css and css/javascript i'm sure you can't set the color of any other element to the default link-color of the browser - but like Machine said, you can try using classes to do this (but you won't be able to use the browser defaults, you have to set your own colors)

    0 讨论(0)
  • 2021-01-18 07:34

    Even if you don't change the default color, it would still be a good idea to specify the color to ensure that it looks the same in all browsers. I'd put something like this in the stylesheet:

    a, span.link {
      color: blue;
    }
    
    a:visited, span.visited {
       color: purple;
    }
    
    a:active, span.active {
       color: red;
    }
    

    Then you can style spans as links by <span class="link">Your fake link</span>

    0 讨论(0)
  • 2021-01-18 07:41

    If you want to set to a new color for a link or to prevent the change of the color of a specific link after visiting it, add inside the <a> tag:

    <A STYLE="text-decoration:none; color=[select your favorite...]" HREF="link.html">test link</A>
    
    0 讨论(0)
提交回复
热议问题