我有这段代码,我想增加我的曲线文本下划线的重量,因为它太细了,实际上没有明显的影响。我读过关于使用边框底部来增加重量的文章,但是我不能让它变成曲线。有没有人有办法解决这个问题?
.underline-yellow{
text-decoration: underline;
text-decoration-color: #FFBE00;
text-decoration-style: wavy;
padding-bottom:2px;
color: black;
}
发布于 2018-07-25 13:12:56
在不更改字体属性的情况下,无法设置文本下划线粗细。
你可以玩background-image
,做一种波浪式的风格。
body {
background: #ccc;
}
.underline-yellow{
color: black;
background-image: linear-gradient(45deg, transparent 65%, yellow 80%, transparent 90%), linear-gradient(135deg, transparent 5%, yellow 15%, transparent 25%), linear-gradient(135deg, transparent 45%, yellow 55%, transparent 65%), linear-gradient(45deg, transparent 25%, yellow 35%, transparent 50%);
background-repeat: repeat-x;
background-size: 20px 5px;
background-position: 0 100%;
padding-bottom: 3px;
}
<span class="underline-yellow">My decorated text</span>
发布于 2018-07-25 14:11:05
请尝试以下操作:
.underline-yellow{
text-decoration: none;
color: black;
box-shadow: 0 1px 0 rgba(0,0,0,0), 0px 1px 0 #f7eb9a;
-webkit-box-shadow: 0 1px 0 rgba(0,0,0,0), 0px 1px 0 #f7eb9a;
}
https://stackoverflow.com/questions/51510429
复制相似问题