我的链接没有我放入的效果

问题描述 投票:0回答:1

我制作的链接保留默认配色方案

nav ul li a{
    color: #white;
    text-decoration: none;
    font-size: 18px;
    position: relative;
}
nav ul li a::after{
    content: '';
    width: 0;
    height: 3px;
    background: #d6799e;
    position: absolute;
    left: 0;
    bottom: -6px;
    transition: 0.5s;
}
nav ul li a:hover:after:{
    width: 100%;
}

我试图不获取默认链接颜色

javascript html css
1个回答
0
投票

你只需要像这样删除 CSS 上的#:

nav ul li a{
    color: white;
    text-decoration: none;
    font-size: 18px;
    position: relative;
}

只有在十六进制颜色如#FFFFFF 或#000000 时才需要输入#。在这里 聆听更多关于 HEX 颜色的信息。

祝你有美好的一天!

© www.soinside.com 2019 - 2024. All rights reserved.