Remove ALL styling/formatting from hyperlinks

后端 未结 4 1927
有刺的猬
有刺的猬 2020-12-22 18:26

I\'m creating a navigation menu with words with different colors (href links). I would like the color NOT to change on any state (hover, visited etc).

I

4条回答
  •  醉话见心
    2020-12-22 19:11

    You can simply define a style for links, which would override a:hover, a:visited etc.:

    a {
      color: blue;
      text-decoration: none; /* no underline */
    }
    

    You can also use the inherit value if you want to use attributes from parent styles instead:

    body {
      color: blue;
    }
    a {
      color: inherit; /* blue colors for links too */
      text-decoration: inherit; /* no underline */
    }
    

提交回复
热议问题