Html 我怎样才能使链接变白?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/528168/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I make links white?
提问by strager
How can I change the colour of hyperlinks to white in HTML and CSS?
如何在 HTML 和 CSS 中将超链接的颜色更改为白色?
回答by strager
Use the color CSS property.
使用颜色 CSS 属性。
a { color: white; }
Problem is, visited links may not be shown as white as well. You may need to add extra rules:
问题是,访问过的链接也可能不会显示为白色。您可能需要添加额外的规则:
a, a:hover, a:active, a:visited { color: white; }
回答by Frost
You use CSS
你使用 CSS
a
{
color: #ffffff;
}
Anchor Pseudo-classes: http://www.w3schools.com/CSS/css_pseudo_classes.asp
回答by Sachin Gaur
just guessing, you may be looking for these as well:
只是猜测,您可能也在寻找这些:
a:link
{
color:#FFFFFF;
}
a:visited
{
color:#FFFFFF;
}
a:hover
{
color:#FFFFFF;
}
回答by Steerpike
a { color: #fff; }
in your css file. I will add that if you're doing it to try and hide many white links on a white background of a page it is a very badidea.
在你的 css 文件中。我要补充一点,如果您尝试在页面的白色背景上隐藏许多白色链接,这是一个非常糟糕的主意。
回答by Mushfiqur Rahman
It can be done in following ways:
1) If you want to color of hyperlinks to white in HTML specific link, then use
可以通过以下方式完成:
1) 如果要将 HTML 特定链接中的超链接颜色设置为白色,请使用
<a href="#" style="color:#ffffff;">Some text</a>
2) To add color of hyperlinks to white in CSS from entire html page, Create a .css file, In that write following:
2) 要将超链接的颜色从整个 html 页面添加到 CSS 中的白色,请创建一个 .css 文件,在该文件中写入以下内容:
{ a, a:hover, a:active, a:visited { color: white; }
It will suppress color of hyperlinks white
from every link
.
它将抑制white
来自每个link
.