css中对文字添加下划线

admin 轻心小站 关注 LV.19 运营
发表于前端技术学习版块 css,教程

CSS中可以使用text-decoration属性来添加下划线到文本中。指定下划线属性值为 underline ,可以增加下划线: { text-decoration: underline; } 属性

CSS中可以使用text-decoration属性来添加下划线到文本中。

指定下划线属性值为"underline",可以增加下划线:

 {       
        text-decoration: underline;
    } 

属性值"none"可以去除下划线:

 {       
        text-decoration: none;
    } 

如果要将下划线改变为其他装饰线,例如中线、虚线、波浪线等:

 {       
        text-decoration: overline;   /* 中线 */
        text-decoration: line-through;   /* 删除线 */
        text-decoration: underline dotted;   /* 虚线 */
        text-decoration: underline wavy;   /* 波浪线 */
    } 

如果想要改变下划线颜色:

 {       
        text-decoration: underline;   
        text-decoration-color: red;
    } 

文章说明:

本文原创发布于探乎站长论坛,未经许可,禁止转载。

题图来自Unsplash,基于CC0协议

该文观点仅代表作者本人,探乎站长论坛平台仅提供信息存储空间服务。

评论列表 评论
发布评论

评论: css中对文字添加下划线

粉丝

0

关注

0

收藏

0

已有0次打赏