Sobes.tech
Junior

What is the difference between a block element and an inline element?

sobes.tech AI

Answer from AI

Block-level occupies the full available width, creates an invisible new line before and after itself, can contain other block and inline elements, and has full control over sizes (width, height).

Inline occupies only the necessary width, does not create a new line, can contain only other inline elements and text, and ignores size changes via width and height (only padding and margin horizontally apply).

Examples:

Block-level: div, p, h1, section. Inline: span, a, strong, em.