And a combination selection on block-level, inline elements

In a recent imitation Baidu home page, select encountered some combination has some vague, so the common combinations selector summarizing, easy to remember to use.

A common combination selector

1.AB descendant selectors, select all descendants of A B, can be selected regardless of nesting.

2.A, B group selector, matching elements A and B, both of the properties are set simultaneously.

3.A> direct child element B sub selectors, A is selected, no other element both tier spacing, no nested layer, only select generation children, grandchildren can not be selected.

4.A + B sibling element selection means for selecting matches both A and B matches the next adjacent element.

5.A ~ B sibling element selector to select and match the next A match i.e. N adjacent element B.

 

II. The block element and the row element

1. The block-level elements

(1) parent element occupies the entire space, thereby forming a block, the block-level element can contain other block elements and lines

(2) can only be used within the body, the default new line, width and height can be provided; not set the width and 100 percent of the entire parent element.

(3) all containers belong to a class label are block-level elements such as: div, li, dt, dd, ul, h.

(4) common block-level elements are:

2. row element

(1) In a row element corresponding frame tag contains only spaces, only contains the data lines and other elements.

(2) the width and height can not be set only in a row, the default character width is the width.

  (3) In addition to common text-level tag line are within the p element. (P which can only put pictures, text and form elements, not put h and p)

(4) common inline elements

 

 

 

Guess you like

Origin www.cnblogs.com/mernva/p/12398659.html