Here are some basic rules that differentiate block elements from inline:
- Block elements will, by default, naturally expand horizontally to fill their parent container, so there’s no need to set a width of “100%”
- Block elements will, by default, begin at the leftmost edge of the parent box, below any previous block elements (unless floats or positioned elements are utilized; see below)
- Inline elements will ignore width or height settings
- Inline elements flow with text, and are subject to typographical properties such as
white-space
,font-size
, andletter-spacing
- Inline elements can be aligned using the
vertical-align
property, but block elements cannot - Inline elements will have some natural space below them in order to accommodate text elements that drop below the line (like the letter “g”)
- An inline element will become a block element if it is floated