html - 为什么我无法将 Text-decoration-style 从 Underline 移除为 None?

标签 html css

当我试图在本地服务器上运行这段代码时,我收到了这个错误。我已经在代码中提到 text-decoration-style: none; 我将文本装饰作为下划线,我想将其删除。

<style>
    li {
        list-style-type: none;
        text-decoration-style: none;
        display: inline-block;
        color: white;
        padding: 20px;
        margin-left: 20px;
    }

    .navbar {
        max-width: 100%;
        background-color: black;
    }
</style>

Image of the Error where m getting error.

最佳答案

如果您使用 anchor <a>li里面那么你应该将它应用到 a不是 li

.navbar ul li a{
    text-decoration: none;
}

关于html - 为什么我无法将 Text-decoration-style 从 Underline 移除为 None?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48995166/

相关文章:

html - 如何在 HTML5 和 CSS3 中自动弹出模态窗口

javascript - 合并/组合文件列表

javascript - 以不同的高度(大型菜单)将一个分区排列在另一个下方

javascript - Angular 4专注于向下箭头上的元素并滚动

html - 响应式文本标题

JavaScript : Change Div Length

javascript - 如何在 JavaScript 中获取文本框的值

css - 选择箭头样式更改

css - 行内 block 元素被推到下一行

css - 除了在我的 CSS 中使用 HOVER 之外的其他选项