html - 从链接的一部分中删除下划线
问题描述
我在它之前有一些内容超链接。和图片一样。
这是我正在使用的代码。
a {
font-size: 14px;
text-decoration: none;
color: $grey;
font-weight: bold;
text-decoration: underline;
&:hover {
cursor: pointer;
}
&:before {
content: '\1F847';
color: $green;
padding-right: 8px;
text-decoration: none;
}
&:after {
text-decoration: none;
}
}
我需要作为内容添加的箭头没有下划线作为文本装饰,但文本需要保留它。如您所见,我尝试添加text-underline:none
之前和之后,但它没有工作。如果需要,我可以使用 JS/Query,但仍然不知道该怎么做。
解决方案
更改:before
伪元素,使其显示为inline-block
:
&:before {
content: '\1F847';
color: $green;
padding-right: 8px;
text-decoration: none;
display: inline-block;
}
推荐阅读
- git - git add -p 和 git add --patch 有什么区别?
- node.js - 在 bcryptjs 中加密和解密
- python - 根据特定列值绘制熊猫数据框的多行的快速方法
- javascript - 使用 Goggle Classroom API 的课程及其学生列表
- python-3.x - 迭代 df 中的行并使用匹配行的列操作结果插入新行
- c# - 如何使用 dapper OracleDynamicParameters() 从过程中获取价值?
- debugging - 捕获定期错误的问题
- html - 如何仅使 div 行的一部分可滚动(使用清晰度而不是引导样式)
- typescript - 如何从单元测试中实例化“vscode 模块”使用的类的对象。错误:找不到模块“vscode”
- php - WooCommerce Rest API 在创建订单中返回无效参数“shipping_lines”