css: properties related to fonts and text and inheritance of properties

1. Font properties

1.color: font color

2.font-size: font size

3. font-family: font

4.font-weight: bolder; The bold font range is 100-900

5.font-style: oblique and italic: text style italic

6.px em: Relative to the font size of the parent element (the default font is 16px)

7.rem is relative to the font size of the root element (the default font size is 16px) screen adaptation method

2. Text class

1. text-align: the horizontal alignment of the text content (left / right / center)

2. ext-decoration: text decoration

underline:下划线
overline:上划线
none:不做修饰
line-through:删除线

3. line-height: line spacing
垂直居中: single line text. The line spacing is set to be the same as the height of the container

4. text-indent: indentation

3. Inheritance of attributes

Inheritance of attributes: Sometimes, after we style an element, the style of its children also changes, that is, the children inherit the attributes of the parent.
1.可继承的属性:

(1) Font family: font, font-size, font-style, font-family, font-weight, etc.

(2) Text category: color, text-indent, text-align, line-height, etc.

(3) Cursor attribute: cursor

(4) Visibility: visibility

(5) Form attributes: border-spacing, border-collapse, caption-side, etc.

(6) List attributes: list-style, list-style-type, list-style-position, etc.

(7) Sound style attributes: volume, voice-family, speak, etc.

(8) Page style attributes: page, windows, orphans, etc.

2.不可继承的属性:

(1) Text attributes: vertical-align, text-decoration

(2) Box model: margin, padding, width, height, border, etc.

(3) Background attributes: background, background-color, background-image, background-repeat (background tiling), background-position (Beijing positioning)

(4)display、margin、border、padding、background

(5) Positioning attributes: position, float, overflow, z-index, left, right, top, bottom, etc.

(6) Height and width attributes: height, min-height, max-height, min-width, max-width

3.所有元素可以继承的属性

(1) Element visibility: visibility

(2) Cursor attribute: cursor

4.内联元素可以继承的属性

(1) Font family attribute

(2) Text series attributes other than text-indent and text-align

5.块级元素可以继承的属性

text-indent、text-align

Guess you like

Origin blog.csdn.net/qq_50487248/article/details/127166147