HTML Tags You Must Know (With Use Cases)

If you’re starting your journey into web development, the first thing you’ll work with is HTML. HTML uses tags to structure content on a webpage.

In this blog, we’ll go through the most important HTML tags you must know as a beginner—especially those used for headings, paragraphs, text formatting, and layout basics.


What Are HTML Tags?

HTML tags are predefined keywords enclosed inside angle brackets (< >) that tell the browser how to display content.

Example:

<p>This is a paragraph</p>

Most tags have:

  • An opening tag

  • A closing tag

Some tags are self-closing, which we’ll also see below.


1. Heading Tags (<h1> to <h6>)

Heading tags are used to define titles and headings on a webpage. All heading tags comes with different sizes <h1> being the largest heading tag, while <h6> being the smallest heading tag.

<h1>Main Heading</h1> <h2>Sub Heading</h2> <h3>Smaller Heading</h3>

Use Cases

  • <h1> → Main page title

  • <h2> to <h6> → Subsections and smaller headings

Best practice: Use only one <h1> per page for better SEO and structure.


2. Paragraph Tag (<p>)

The <p> tag is used to write paragraphs of text.

<p>This is a paragraph of text.</p>

Use Cases

  • Blog content

  • Descriptions

  • Articles

Browsers automatically add spacing before and after paragraphs.


3. Line Break Tag (<br>)

The <br> tag inserts a line break without starting a new paragraph.

Hello<br> World

Use Cases

  • Addresses

  • Poems

  • Breaking lines inside text

<br> is a self-closing tag, so it doesn't need a closing tag.


4. Horizontal Rule (<hr>)

The <hr> tag creates a horizontal line to separate content.

<hr>

Use Cases

  • Separating sections

  • Dividing topics visually

It improves readability in long pages.


5. Bold Text (<strong>)

The <strong> tag makes text bold and also gives it importance.

<strong>Important text</strong>

Use Cases

  • Highlighting key points

  • Emphasizing important words

Search engines treat <strong> text as meaningful.


6. Italic Text (<em>)

The <em> tag is used for emphasized (italic) text.

<em>Emphasized text</em>

Use Cases

  • Stressing a word

  • Quoting thoughts or ideas


7. Underline Text (<u>)

The <u> tag underlines text.

<u>Underlined text</u>

Use Cases

  • Highlighting text visually

  • Special emphasis

Use carefully—underlines can look like links.


8. Small Text (<small>)

The <small> tag displays text in a smaller font size.

<small>Copyright notice</small>

Use Cases

  • Disclaimers

  • Copyright text

  • Side notes


9. Superscript (<sup>) and Subscript (<sub>)

H<sub>2</sub>O 10<sup>2</sup>

Use Cases

  • Chemical formulas

  • Mathematical expressions

  • Footnotes


10. Comment Tag (<!-- -->)

Comments are not visible on the webpage but help developers understand the code.

<!-- This is a comment -->

Use Cases

  • Explaining code

  • Temporary notes

  • Debugging


Why These Tags Matter

These basic tags:

  • Form the structure of webpages
  • Improve readability
  • Help search engines understand content
  • Are used in almost every website

Mastering them is essential before moving to CSS or JavaScript.


Conclusion

HTML tags are the foundation of web development. Understanding headings, paragraphs, line breaks, and text formatting tags will help you build clean and well-structured webpages.

Once you’re comfortable with these, learning CSS and JavaScript becomes much easier.

Comments

Popular posts from this blog

Numbers & Numeric Operations in C++: Data Types & cmath Functions

Introduction to C++: Your First Program & Hello World

Intro to C++ for Beginners

User Input in C++: Reading Data from Keyboard with cin & getline()

Mad Libs Game in C++: Build Your First Interactive Program

Strings in C++: Basics, Methods & Examples

Variables & Data Types in C++: Basics with Examples

Printing Patterns in C++: Shape Output with Loops & Logic

Return Statement in C++: Syntax, Purpose & Examples

Functions in C++: Syntax, Use & Examples