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:
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.
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.
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.
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.
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.
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.
Use Cases
-
Stressing a word
-
Quoting thoughts or ideas
7. Underline Text (<u>)
The <u> tag underlines text.
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.
Use Cases
-
Disclaimers
-
Copyright text
-
Side notes
9. Superscript (<sup>) and Subscript (<sub>)
Use Cases
-
Chemical formulas
-
Mathematical expressions
-
Footnotes
10. Comment Tag (<!-- -->)
Comments are not visible on the webpage but help developers understand the code.
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
Post a Comment