In HTML, elements are broadly divided into two categories: block-level and inline. Block elements take up the full width, while inline elements only take as much space as needed.
Block Elements | Inline Elements | Comparison
The <div> tag defines a block container for grouping content.
This is a paragraph.
The <p> tag defines a block of text that starts on a new line.
<h1> is the largest heading and block-level.
<h2> is a subheading and block-level.
<h3> is smaller than h2 and block-level.
<h4> is used for sub-subheadings.
<h5> is rarely used but still block-level.
<h6> is the smallest heading.
<ul> creates a bullet list.
<ol> creates a numbered list.
"Coding is the new literacy."
<blockquote> is used for quotations.
<hr> creates a horizontal line.
Row 1 Col 1 | Row 1 Col 2 |
Row 2 Col 1 | Row 2 Col 2 |
<table> displays tabular data.
This is a span element inside a sentence.
<span> is an inline container.
Visit our site for more info.
<a> creates hyperlinks.
This is bold text.
<b> makes text bold.
This is italic text.
<i> makes text italic.
This is underlined text.
<u> underlines text.
This is strong emphasis.
<strong> indicates importance.
This is emphasized text.
<em> adds emphasis.
E = mc2
<sup> creates superscript.
H2O is water.
<sub> creates subscript.
This is highlighted text.
<mark> highlights text.
HTML stands for HTML.
<abbr> defines abbreviations.
Use console.log("Hello")
to print in JS.
<code> shows code snippets.
Block Elements | Inline Elements |
---|---|
<div> | <span> |
<p> | <a> |
<h1> | <b> |
<ul> | <i> |
<blockquote> | <abbr> |
<table> | <code> |
<hr> | <sup> |
<section> | <mark> |