HTML & CSS · Junior · Question 6 of 75
How does display: inline-block differ from inline?
- 1
inline-blockalways starts on a new line and stretches to the parent's full width - ✓Correct answer:
inline-blockstays in the line of text but accepts width, height and vertical spacing - 3
inline-blockalso ignoreswidthandheightbut never wraps to a new line
Explanation
inline-block is a hybrid: on the outside it behaves like an inline element (sits on the same line as its neighbors and respects vertical-align), and on the inside like a block (width, height, padding and vertical margin work). It's block that starts on a new line, not inline-block.