The front end of the second week of learning

The concept of layered and inheritance

  Text general properties of the class are inherited, namely CSS properties of an element is passed to the internal nested elements. An element may have one or more sources of style, the property when the property conflict, will be displayed after loading according to the order and the right to decide major small stack.

Priority selector

          Row id class element
Row 1 0 0 0
id 0 1 0 0

class, attributes, pseudo-class

0 0 1 0
Elements, pseudo-elements 0 0 0 1
Tsuhaifu * 0 0 0 0
!important highest

 

Box Model

  

margin
border
padding
content

Positioning ( position )

  relative: to make the absolute father, and with the z-index (the default is auto, auto 0 is calculated, but the auto and z-index: 0 on the different values ​​at the higher.)

  absolute: a layer from the document flow, to find a parent element in a first positioning element (position is that there is not a static element positioning)

  fixed: this will be fixed on the page, drag up and down your pages are the same, microblogging back to the top of the inside is so used

  sticky: not out of the page when it is normal relative, it is fixed at the top

Normal flow

  Conventional flow, document flow, ordinary document flow, regular document flow

  All the elements, by default, are all conventional flow layout

  General rule: block own line box, the horizontal line are sequentially arranged in the cartridge

  Comprising a block (containing block): Each box has its containing block, decision block comprising a box arrangement region.

  The vast majority of cases: a block containing box, the contents of the cartridge to its parent element

Guess you like

Origin www.cnblogs.com/xf2019/p/12043865.html