CSS下划线是一种常见的文本效果,可以用于强调某些文本内容,下面来介绍一下CSS下划线的一些属性。.text { text-decoration: underline; text-underline-
CSS下划线是一种常见的文本效果,可以用于强调某些文本内容,下面来介绍一下CSS下划线的一些属性。
.text { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #333; text-decoration-style: dotted; }
text-decoration是用来添加下划线的属性。默认值是none,表示没有下划线。设置为underline后会给文本添加下划线。如果需要删除下划线可以将值设置为line-through。也可以同时设置多个值,例如text-decoration: underline line-through。
text-underline-offset是设置下划线相对于文本的垂直偏移量。可以设置为负值,表示下划线在文本的下方;也可以设置为正值,表示下划线在文本的上方。
text-decoration-color是设置下划线的颜色。可以设置为任何颜色值,包括关键字、RGB值、十六进制值、HSL值等。
text-decoration-style是设置下划线的样式。有四种样式可选:solid(实线)、dashed(虚线)、dotted(点线)、double(双下划线)。
在使用CSS下划线时,可以根据需要进行组合使用,实现不同的效果。
粉丝
0
关注
0
收藏
0