HTML provides many tags for structuring content, formatting text, creating links,
displaying images, building tables, collecting form data, embedding media, and defining
semantic page layouts. This guide organizes all important HTML tags by category with
examples and practical usage.
What Are HTML Tags?
HTML tags are markup instructions used to define elements on a web page.
Most HTML elements have an opening tag, content, and a closing tag.
<p>This is a paragraph.</p>
Some tags are void elements, meaning they do not need a closing tag.
Defines browser tab title and search result title.
<title>HTML Tutorial</title>
<meta>
Defines charset, viewport, description, robots, and other metadata.
<meta name="description" content="Learn HTML tags." />
<link>
Links external resources like CSS, canonical URLs, and icons.
<link rel="stylesheet" href="/style.css" />
<base>
Defines a base URL for relative links.
<base href="https://example.com/" />
<style>
Adds internal CSS styles.
<style>body { margin: 0; }</style>
Text and Content Tags
Tag
Usage
Example
<h1> to <h6>
Creates heading hierarchy.
<h1>Main Title</h1>
<p>
Creates a paragraph.
<p>Learn HTML tags.</p>
<br>
Adds a line break.
Line one<br />Line two
<hr>
Adds a thematic break.
<hr />
<blockquote>
Represents a long quotation.
<blockquote>Quote text</blockquote>
<pre>
Preserves whitespace and line breaks.
<pre>Formatted text</pre>
<code>
Represents inline code.
<code>npm install</code>
<abbr>
Defines an abbreviation.
<abbr title="HyperText Markup Language | PHPKINGDOM">HTML</abbr>
<address>
Represents contact information.
<address>contact@example.com</address>
Formatting and Inline Text Tags
Tag
Usage
Example
<strong>
Marks important text.
<strong>Important</strong>
<b>
Makes text bold visually.
<b>Bold text</b>
<em>
Emphasizes text semantically.
<em>Read carefully</em>
<i>
Displays alternate voice or italic text.
<i>Technical term</i>
<mark>
Highlights relevant text.
<mark>Highlighted</mark>
<small>
Represents small print or side comments.
<small>Terms apply</small>
<del>
Shows deleted text.
<del>$99</del>
<ins>
Shows inserted text.
<ins>$79</ins>
<sub>
Creates subscript text.
H<sub>2</sub>O
<sup>
Creates superscript text.
10<sup>2</sup>
<span>
Generic inline wrapper.
<span class="badge">New</span>
Inline vs Block Tags
HTML elements are often grouped as inline or block-level tags. Inline tags stay
inside the flow of text, while block tags start on a new line and usually take
up the full available width.
Type
Common Tags
Behavior
Inline
<span>, <a>, <strong>, <em>, <img>
Flows with surrounding text and only takes the space it needs.
Block
<div>, <p>, <h1> to <h6>, <section>, <article>
Starts on a new line and stretches across the available width.
Inline Tags Example
<p>
Learn <strong>HTML</strong> with <a href="/tutorials/html/">examples</a>.
</p>
Inline tags are useful for styling or linking small pieces of content without
breaking the line.
Block Tags Example
<section>
<h2>HTML Basics</h2>
<p>This is a block-level section with its own space.</p>
</section>
Block tags are useful for organizing page sections, content areas, forms, and layouts.
<span> is a common inline wrapper.
<div> is a common block wrapper.
<img> is inline by default, even though it behaves like a replaced element.
Some older HTML tags are obsolete and should not be used in modern web development.
Use CSS and semantic HTML instead.
Old Tag
Status
Modern Replacement
<font>
Obsolete
Use CSS font styles.
<center>
Obsolete
Use CSS text alignment or layout.
<big>
Obsolete
Use CSS font-size.
<strike>
Obsolete
Use <del> or CSS.
<frame>
Obsolete
Use modern layouts or <iframe> when needed.
<frameset>
Obsolete
Use semantic HTML and CSS layout.
<marquee>
Obsolete/non-standard
Use CSS animations carefully.
SEO and Accessibility Tips for HTML Tags
Use one clear <h1> for the main page topic.
Use headings in logical order: <h2>, then <h3>.
Use semantic tags like <main>, <article>, and <section>.
Use <nav> for important navigation links.
Add useful alt text for informative images.
Use <label> for form fields.
Use <caption> and <th> for accessible tables.
Avoid obsolete tags and use CSS for visual styling.
Common HTML Tag Mistakes
Using <div> for everything instead of semantic tags.
Skipping closing tags where they are required.
Using headings only for font size instead of content structure.
Using tables for page layout instead of tabular data.
Forgetting alt text for meaningful images.
Using obsolete tags like <font> or <center>.
Putting visible content inside <head> instead of <body>.
Key Takeaways
HTML tags define the structure and meaning of web page content.
Tags can be grouped by document, metadata, text, formatting, links, media, lists, tables, forms, semantic layout, and scripting.
Use semantic HTML tags for better SEO, accessibility, and maintainability.
Use tables for tabular data, forms for input, and media tags for images, audio, and video.
Avoid obsolete HTML tags and use CSS for visual styling.
Pro Tip
When choosing an HTML tag, think about meaning first. Use semantic tags for structure,
form tags for input, table tags for data, and CSS for visual design.
You now understand all important HTML tags by category, their usage, examples,
SEO benefits, accessibility benefits, obsolete tags, and common mistakes.