The difference between the CSS block, inline, inline-block of

block

Block-level elements features:

1, each of the block-level element start a new line, and the subsequent elements are also on a separate line.

2, height, width, line height, and a top margin and a bottom element can be set.

3, in the case where the width of the elements is not provided, is the (same width and the parent element) 100% of the parent container itself, unless a set width.

 

 

inline

Features inline elements:

1, and other elements on one line;

2, the height, width, and top and bottom margins of elements is not provided;

3, the width of the elements is that it contains text or image width can not be changed.

 

 

inline-block

Inline block elements (inline-block) is also have the characteristics of inline elements, block elements.

inline-block elements Features:

1, and other elements on one line;

2, height, width, line height, and a top margin and a bottom element can be set.

Guess you like

Origin www.cnblogs.com/kitty-blog/p/11776165.html