CSS的属性有很多,总体来说有2种:不可变属性和可变属性
一.可继承属性
- 父标签的属性值会传递给子类标签
- 一般是文字控制属性

二.不可继承属性
- 父标签的属性值不能传递给子类标签(可以说是父类标签私有的)
- 一般是区块控制属性

三.所有标签可继承(加粗的表示常用)
-
1.隐藏标签 visibility
visibility: hidden;仅仅隐藏内容,不隐藏尺寸
display: none;全部隐藏(包括尺寸)-
介绍一个标签隐藏
隐藏的展示
-
visibility更多的属性
visibility
-
-
2.改变光标的属性 cursor


四.内联标签可继承(加粗的人常用)
letter-spacing , word-spacing , white-space , line-height , color , font , font-family , font-size , font-style , font-variant , font-weight , text-decoration , text-transform , direction

讲解一下去除下划线text-decoration (一般用于p标签)

五.块级标签可继承
text-indent(首行缩进) ,text-align (居中或者其他位置)

六.列表标签可继承
** list-style** , list-style-type, list-style-position, list-style-image

七.不可继承属性

下面展示一下
1.background

2.overfllow

如果不设置overfllow会超出范围,如下

网友评论