CSS selectors What? What attributes can be inherited? How priority algorithm?

CSS selectors What?

1.id selector (#id)

2. class selector (.class)

3. tag selector (div, h1, p)

4. adjacent selector (h1 + p)

The child selector (ul> li)

6. descendant selectors (li a)

7. Wildcard selector (*)

8. attribute selector (a [title])

9. The pseudo class selector (a: hover, li: nth-child)

 

 

Inheritable style

1.字体系列属性 font,font-family,font-weight,font-size,font-style,font-variant,font-stretch,font-size-adjust

2. Text series attribute text-indent, text-align, line-height, word-spacing, letter-spacing, text-transform, direction, color

3. element visibility visibility

4. The table layout attributes caption-side, border-collapse, border-spacing, empty-cells, table-layout

The attribute list layout list-style-type, list-style-image, list-style-position, list-style

6. generate content attribute quotes

7. cursor property cursor

8. Page Style property page, page-break-inside, windows, orphans

9.声音样式属性 speak,speak-punctuation,speak-numeral,speak-header,speech-rate,volume,voice-family,pitch,pitch-range,stress,richness,azimuth,elevation

 

How priority algorithm?

1. Under the priority principle of proximity, the same weight, whichever the case recently defined style;

2. Load last loaded positioning styles to prevail;

3.!important > id > class > tag;

4.important higher priority than the inline, but higher than inlining ID;

Guess you like

Origin www.cnblogs.com/miluluyo/p/11134342.html
Recommended