Block and inline elements in HTML
Each element in HTML has a default display value, depending on which element it is.
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 usually 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 usually 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 be used to style the content block.
span element
The span element is usually 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 be used to style the content block.
Discover more
HTML learn html learn html5Share by
Kareem WintersYou should read it
- Introduction to HTML5
- Semantic Element in HTML5
- Style HTML with CSS
- Quote elements in HTML
- Image img in HTML
- The Quiet Details That Make a Sports Betting Platform Feel Reliable
- Instructions on creating toy set images with ChatGPT AI
- How are AI agents changing the journalism industry?
- Class properties in HTML
- The id attribute in HTML
- Iframe in HTML