Priority, the cartridge model concept laminated and inheritance, selector element system is positioned on the page, a conventional flow

1. stacked and the concept of inheritance:

CSS laminate refers to the CSS style configuration the same property for the same element is, according to the cascading rules (weight) to conflict, choose to apply high weight CSS selectors specified attributes, also generally described as a high weight to cover low weight therefore also called laminate.

Inheritance: child elements will automatically have some CSS properties of the parent element, generally speaking, the text will be inherited class attributes (font, size, color)

Priority 2. selector

! important> id selector> class selector> tag selector> child selectors> descendant selectors> pseudo-class selector

3. Box Model

Page, the size of a space occupied by the box made up of several parts, including the border element content (Content), the padding element (padding), the element (border), outside of an element (margin), four portions together constitute the CSS box model elements.

4. elements on the page positioning system

Conventional flow (normal flow), float (float), absolute positioning (absolute positioned)

The normal stream

Css without the intervention of block elements on a separate line, width and height can be provided; inline elements side by side, the width and height automatically.

When the floating elements, from the document flow. Because the lead after a child of the parent element floating height collapse.

Guess you like

Origin www.cnblogs.com/tianna/p/12046464.html