如何在 CSS 中更改 link 的颜色

How can change link's color in CSS

我的内容中有很多 link

如何在向用户显示内容时找到 div 标签中的所有 link 并更改颜色?

像这样:

pleas visit my own site's : telegram.org , www.google.com , www.wikipedia.com , ... 
and send mail to : mymail@gmail.com

如果你想设置 link 的样式,你应该使用 css 来做到这一点:

.new_link {
  background-color: black;
  color: white;
}
<div>
  <a class="new_link" href="#link2" id="link1">Go to next link</a>
  <br>
  <a class="new_link" href="#link1" id="link2">Go to link1</a>
  Some other text that will not be styled
</div>

这里我在link元素(<a>元素)中添加了一个class。

通过添加 class 他们得到 css 样式。
我在这里选择的样式是:
背景颜色 颜色(文本颜色)

您可以为页面上的所有 <a> 元素创建 css 规则(如上)。
另一种可能性是向 <div> 元素添加 class,并在 div 中添加 select 所有 link。 css 可以实现所有这些。

如果您想更改所有页面或应用程序中 link 的颜色,请在 css..

中执行此操作
a {
    color: red;/*color name, color code or rbg*/
}

如果您想更改特定的 link 颜色....

a.highlight {
   color: red;
}

如果您想更改特定 div 中所有 link 的颜色......

.content a{
    color:red;
}