html - Text-Decoration: none Not working for links?
问题描述
text-decoration: none;
Is not working... My browser is Chrome, and the code is below:
.hotbar li {
float: right;
display: inline-block;
color: red;
margin: 0 50px;
text-decoration: none;
}
<nav class="hotbar">
<ul>
<li> <a href="http://127.0.0.1:64310/about.html" target="_blank">About</a></li>
<li> <a href="http://127.0.0.1:64310/platforms.html" target="_blank">Platforms</a></li>
<li> <a href="http://127.0.0.1:64310/contact.html" target="_blank">Contact</a></li>
</ul>
</nav>
解决方案
您需要从锚点中删除文本装饰。因此,将您的选择器更改为.hotbar li a
.hotbar li a {
float: right;
display: inline-block;
color: red;
margin: 0 50px;
text-decoration: none;
}
<nav class="hotbar">
<ul>
<li> <a href="http://127.0.0.1:64310/about.html" target="_blank">About
</a></li>
<li> <a href="http://127.0.0.1:64310/platforms.html" target="_blank">Platforms
</a></li>
<li> <a href="http://127.0.0.1:64310/contact.html" target="_blank">Contact
</a></li>
</ul>
</nav>
推荐阅读
- angular - 如何从 Angular 项目之外的页面上的 SELECT 字段传递数据?
- javascript - 在渲染之前更改从道具派生的状态
- javascript - 当输入值> 0 && value !== undefined 时,尝试删除 html 按钮标签上的禁用属性
- laravel - 电子邮件与使用 get 请求的路由一起使用,但电子邮件不会与 post 请求一起发送,并且没有错误,只是页面刷新
- openlayers - 我如何为移动设备添加自定义搜索
- c++ - 如何更改子类方法中的参数?
- javascript - 使用可观察和订阅
- node.js - MongoDB查询名称忽略尾随数字
- javascript - Flask 无法处理 ajax GET 请求中的 json 数据
- c# - Azure 函数不会创建 blob 元数据