gpt4 book ai didi

css - 如何将颜色更改为div中的链接?

转载 作者:行者123 更新时间:2023-11-28 07:01:46 25 4
gpt4 key购买 nike

我创建了(从在线工具复制和编辑)一个带有文本 here on the botton right corner 的小方框

我还想更改框中文本的颜色。但是有命令 a:link, a:visited。

我怎样才能绕过这些命令并为文本提供我想要的颜色,同时保持链接?

谢谢

最佳答案

伪选择器 a:link 和 a:hover(以及更多)改变了浏览器的默认行为。您可以省略它们,但我敢肯定您不想这样做。

a:link 设置 anchor 的样式,因此它不是默认的蓝色下划线。

a:hover 设置当您将鼠标移到链接上时 anchor 的样式。

使用您选择的搜索引擎了解更多信息,试试“css pseudo selector”

看代码,颜色设置都有:

.button {
display: inline-block;
text-align: center;
vertical-align: middle;
padding: 12px 24px;
border: 1px solid #28A26B;
border-radius: 8px;
background: transparent
linear-gradient(to bottom, #FFF, #FFF)
repeat scroll 0% 0%;
// this is what you're probably
// looking for - the color of the button body.
// It's set to transparent.
font: bold 20px arial;
color: #28A26B; // Color of the content
text-decoration: none;
}
.button:hover, .button:focus {
// these pseudo classes just make the js events onmouseover
// and onclick obsolete...
color: #28A26B;
text-decoration: none;

}

将背景设置为您选择的颜色,移除渐变部分,您就完成了。不要盲目复制。

关于css - 如何将颜色更改为div中的链接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33187430/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com