css的下划线,在display怎么去除下划线

html-css011

css的下划线,在display怎么去除下划线,第1张

css去掉下划线只要我们把text-decoration属性改成none就可以了。

并不是很难,在HTML中,我们可以使用u标签来加下划线,但是在css中我们只能使用text-decoration属性,我们想把下划线设置成红色,只要我们保持和字体的颜色相同就可以了。在css中,我们可以使用text-decoration属性来表示下划线和删除线等样式,首先我们要了解一下text-decoration属性。

text-decoration属性一共有五个值,分别是none,blink,underline,line-through,overline,其中underline就表示下划线。语法如下:

div{text-decoration:none}表示:一般去掉下划线

div{text-decoration:underline}表示一般添加下划线样式

div{text-decoration:line-through}一般表示贯穿线

div{text-decoration:overline}设置上划线样式

class{text-decoration:none}

class改成你不要下划线样式的名字就行,如果用ID的 #id

a, a:hover, a:focus { text-decoration: nonecolor: inherit} //初始化所有情况下a不要下划线。

下面是关于text-decoration下划线CSS单词值参数:

none :  无装饰

blink :  闪烁

underline :  下划线

line-through :  贯穿线

overline :  上划线

text-decoration:none 无装饰,通常对html下划线标签去掉下划线样式

text-decoration:underline 下划线样式

text-decoration:line-through 删除线样式-贯穿线样式

text-decoration:overline 上划线样式