html - 鼠标悬停时CSS更改链接颜色

标签 html css colors hyperlink hover

我有以下 CSS 部分,其中包含普通文本和一些网络链接。我需要将鼠标悬停在段落部分的链接更改颜色。我该怎么做?

我试过:

        ul.contact li p:hover a {
        color: #eb050183;
    }

我的 CSS

ul.contact li {
    position: relative;
    border-top: solid 1px #ddd;
    padding: 1.3em 0 1.3em 7em;
}

    ul.contact li h3 {
        position: absolute;
        left: 0;
        top: 1.3em;
        font-size: 1.1em;
    }

    ul.contact li p {
        margin: 0;
        font-size: 0.9em;
    }

    ul.contact li:first-child {
        padding-top: 0;
        border-top: 0;
    }

        ul.contact li:first-child h3 {
            top: 0;
        }

最佳答案

要在悬停时更改 anchor 链接的颜色,您需要按如下方式设置 CSS:

 ul.contact li p a:hover {
        color: #eb050183;
    } 

关于html - 鼠标悬停时CSS更改链接颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50656745/

相关文章:

android - onclick 仅在点击三下后触发

jquery - 需要在中间 'div' 左侧 'div' 显示一个列表项触发的 html 页面

html - 将 ul 列表移到 div 下面

Javascript 背景改变颜色

graphics - RGB滤镜用于不同形式的色盲

html - 调整 tablecell 中的 img-height

html - 如何保存(而不是部署)mkdocs 以在本地以 HTML 形式浏览?

css - 需要 CSS 帮助 - 在多种分辨率下水平绝对定位 DIV(偏离中心)

css - 移动菜单切换到文本

c - c中表格内的不同颜色