How to remove the default link color of the html hyperlink 'a' tag?

后端 未结 12 2152
时光说笑
时光说笑 2020-12-07 08:56

The default link color is blue. How to remove the default link color of the html hyperlink tag ?

12条回答
  •  北荒
    北荒 (楼主)
    2020-12-07 09:26

    The inherit value:

    a { color: inherit; } 
    

    … will cause the element to take on the colour of its parent (which is what I think you are looking for).

    A live demo follows:

    a {
      color: inherit;
    }

    The default color of the html element is black. The default colour of the body and of a paragraph is inherited. This link would normally take on the default link or visited color, but has been styled to inherit the color from the paragraph.

提交回复
热议问题