1. Inline elements (inline element inlineelement)
Features: Do not occupy a row, can not set the width and height of the row height, its breadth as the content increases, height with the font size and change, margin only to the left and right, the upper and lower invalid.
Common are:
A-anchor point, B-Bold (not recommended), BR-newline, em-accent, font-typeface (not recommended), I-Italic, img-picture, input-input box, label-table label,
Select-Project selection, small-small font text, span-common inline container, define text within chunks, strike-underline, strong-bold accent
2, block-level elements
Features: Beginning to occupy a row from the new line, you can set the width of high, row high, internal and external margins, the width of the default browser width, height with the font size and change, margin only to the left and right, the upper and lower invalid.
Common are:
Div-most commonly used block-level elements, DL-and DT DD with block-level elements, form-interactive form, H1-big title, hr-Horizontal divider, ol-Sort form, p-paragraph, ul-non-sorted
Tips:1, display can convert inline elements and block-level elements to each other under certain circumstances
2. Text-align:center can center inline elements in block-level elements, but cannot be centered with margin:0 auto when the inline element is set to block-level elements, in which case the Padding property can be used to extend the width of the inline element without changing its inline property. can be centered.
3, the current use of the center mode, the horizontal center text-align:center can make the picture or text in the block level elements of the horizontal center, line-height can be set to the same height as the block-level elements, to achieve horizontal center; block-level elements are centered using margin:0 Auto.
CSS base inline element block level element