Table of Contents
Block and Inline Elements in HTML is easier to understand when the core ideas are paired with practical examples. The sections below explain the topic clearly, highlight useful steps, and point out details that can prevent common errors.
Each element in HTML has a default display value, depending on which element it is. The default display value of most elements is block or inline.
Block elements
Block elements typically start at the beginning of the line and take up the full width possible (from left to right)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inline element
The inline element does not start a new line and takes only the required width.
Inline Elements in HTML
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
div element
The div element is typically used to contain other HTML elements, it has no required attributes but style, class and id are common attributes. When used with CSS, the div element can help style the content block.
span element
The span element is typically used to contain text elements in HTML, it has no required attributes but style, class and id are common attributes. When used with CSS, the span element can help style the content block.
FAQ
What should you know about block elements?
Block elements typically start at the beginning of the line and take up the full width possible (from left to right).
What should you know about inline element?
The inline element does not start a new line and takes only the required width.
What should you know about inline Elements in HTML a cite label abbr code map acronym dfn object b em q bdo i samp big img script br input select button kbd small span strong sub sup textarea time tt var div element?
The div element is typically used to contain other HTML elements, it has no required attributes but style, class and id are common attributes. When used with CSS, the div element can help style the content block.
Reader Comments 0
Sign in with email or Google to join the discussion.