What is the difference between inline, block and inline-block?
These are values of the display property.
| Value | New line | Width and height | Example |
|---|---|---|---|
block | Yes | Work | div, p |
inline | No | Ignored | span, a |
inline-block | No | Work | buttons, menu items |
Output in the browser
one two
See the display property.
Learn more about the similar topics:
| Tutorials |
|---|
| CSS Layout – The display Property |
| CSS Position Property |
| CSS z-index |
| CSS Float and Clear Property |
| Exercises & Assignments |
|---|
| Write CSS to centre a box horizontally using margin auto |
| Write CSS to create a horizontal navigation menu |