在CSS中,我们可以通过text-decoration属性来设置字体下划线。下面是具体的方法:
使用CSS设置文本下划线:
在CSS中,通过text-decoration属性可以设置文本的下划线。可以使用下面的CSS样式来设置文本下划线:
字符型文本:
p.char-underline{
? text-decoration: underline; //设置文本下划线
}
链接文本:
p.link-underline{
? text-decoration: underline; //设置链接文本下划线
}
去掉文本下划线:
p.no-underline{
? text-decoration: none; //去掉文本下划线
}
这样,你就可以自由地在CSS中设置字体下划线了。
【代码片段】
p.char-underline{
? text-decoration: underline; //设置文本下划线
}
p.link-underline{
? text-decoration: underline; //设置链接文本下划线
}
p.no-underline{
? text-decoration: none; //去掉文本下划线
}
文章说明:
本文原创发布于探乎站长论坛,未经许可,禁止转载。
题图来自Unsplash,基于CC0协议。
该文观点仅代表作者本人,探乎站长论坛平台仅提供信息存储空间服务。