Coding Now – Best AI & Full Stack Courses in Delhi NCR | 100% Placement
Limited Offer: Get 50% OFF on AI & Full Stack Courses
📞 Call Now: +91 9667708830
Back to HTML Notes
Topic #109

HTML Tags — Paired, Void & Deprecated

A tag is the markup itself — the part wrapped in angle brackets. HTML has three kinds: paired tags, void (self-closing) tags, and — rarely seen today — deprecated tags you should avoid.

Paired Tags

<p>...</p>
<div>...</div>
<h1>...</h1>

Most tags come in an opening/closing pair and wrap content.

Void Tags

<img src="photo.jpg" alt="Description">
<br>
<hr>
<input type="text">
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">

These never wrap content and never have a closing tag — they're complete on their own.

Deprecated Tags — Avoid in New Code

Deprecated TagUse Instead
<center>CSS text-align: center
<font>CSS font-family, color, font-size
<marquee>CSS animations (and generally, don't)
<u> for stylingCSS text-decoration: underline — but see Underline Text for when <u> is still semantically appropriate

Practical Use Case

Knowing which tags are deprecated matters when maintaining older codebases or reviewing legacy code — you'll recognize them immediately and know the modern replacement.

Common Mistakes

  • Using presentational tags (<b>, <i>) purely for visual bold/italic styling where a semantic tag (<strong>, <em>) would communicate meaning, not just appearance — see strong vs bold-text
  • Copy-pasting old code containing deprecated tags into a new project without updating it

Interview Relevance

You may be asked to name a few deprecated HTML tags and their modern replacements — a quick way to gauge whether a candidate has kept their knowledge current.

Practice Question

Rewrite <center><font color="red">Sale!</font></center> using modern HTML and CSS instead.

Related HTML Notes

Want to go beyond the notes?

Join CodingNow's HTML course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available
💬 Talk to Advisor
1
WhatsApp

Latest from Our Blog

Insights on AI, Data Science, Full Stack & Career

View All Articles →