HTML Elements Showcase – Inline vs Block

In HTML, elements are broadly divided into two categories: block-level and inline. Block elements take up the full width and always start on a new line, while inline elements only take as much space as needed within a line.


Block Elements

This is a <div> element

Explanation: Div is a generic block container.

This is a <p> element

Explanation: Paragraph defines a block of text that starts on a new line.

This is H1

This is H2

This is H3

This is H4

This is H5
This is H6

Explanation: Headings are block-level elements that structure content.

Explanation: Unordered list defines bullet points.

  1. First
  2. Second

Explanation: Ordered list defines numbered items.

"Coding is the new literacy."

Explanation: Blockquote is a block container for quotations.


Explanation: The hr tag defines a horizontal separator.

Row 1 Col 1Row 1 Col 2
Row 2 Col 1Row 2 Col 2

Explanation: Table creates a grid structure.


Inline Elements

This is inside a span element.

Explanation: Span is an inline container with no new line.

Visit this link for more info.

Explanation: The a tag defines hyperlinks.

This is bold text.

Explanation: b makes text bold.

This is italic text.

Explanation: i makes text italic.

This is underlined text.

Explanation: u underlines text.

This is strong text.

Explanation: strong adds importance with bold emphasis.

This is emphasized text.

Explanation: em italicizes with emphasis.

E = mc2

Explanation: sup defines superscript text.

H2O is water.

Explanation: sub defines subscript text.

This is highlighted text.

Explanation: mark highlights text.

HTML stands for HTML.

Explanation: abbr defines an abbreviation.

Example code: console.log("Hello World")

Explanation: code represents inline programming text.


Inline vs Block Comparison

Differences Between Inline and Block Elements
Block Elements Inline Elements
<div><span>
<p><a>
<h1><b>
<ul><i>
<blockquote><abbr>
<table><code>
<hr><sup>
<section><mark>

[Back to Top]