css的class命名中可不可以有下划线

html-css088

css的class命名中可不可以有下划线,第1张

可以,符合css语法规定

只是Opera浏览器有一两个版本不认下划线

(很老的版本了,本来这个浏览器用户也不多,你可以选择忽略)

要保险的话统一用中划线...

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 上划线样式