如何删除 html 超链接“a”标签的默认链接颜色?
P粉432906880
P粉432906880 2023-08-23 16:28:59
0
2
799
<p>默认链接颜色为蓝色。 如何删除 html 超链接标签 <code><a></a></code><a> 的默认链接颜色?</a></p>
P粉432906880
P粉432906880

全部回复(2)
P粉403804844

继承值

a { color: inherit; }

...将导致元素呈现其父级的颜色(我认为这就是您正在寻找的)。

现场演示如下:

a {
  color: inherit;
}
<p>The default color of the html element is black. The default colour of the body and of a paragraph is inherited. This
  <a href="http://example.com">link</a> would normally take on the default link or visited color, but has been styled to inherit the color from the paragraph.</p>
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!