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

标签 css

我创建了(从在线工具复制和编辑)一个带有文本 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/

相关文章:

c# - 是否可以将背景位置添加到 img/asp :image tag

javascript - WebWorks 应用程序根本无法运行,但可以在 Ripple 和 Chrome 以及 BB 浏览器中运行

html - 如何调整图像大小以适应浏览器窗口?

css - 不同的字体在 OS X 上垂直对齐

Jquery 选项卡帮助

css - 标题顶部的填充

javascript - 如何为我的分页添加格式

html - 甲骨文顶点 5 : Set max height of Interactive Report

css - 伪元素之前/之后

html - 在 SharePoint 2007 中单击 CSS 显示/隐藏 div