#1 India's Top IT Training Institute
×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
Mentors

Mentors

Meet the industry experts who train and guide you through your course.

Read More →
Free Resources

Free Resources

Free tutorials, interview questions, tools and calculators to help you learn.

Explore →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
HTML Fundamentals

HTML Formatting

HTML formatting elements mark parts of text with a particular meaning, such as importance, emphasis, a highlight, a deletion or a chemical formula. Browsers give most of them a default look, bold, italic or underlined, but the reason to choose one is what it means. Picking the right element helps screen readers, search engines and anyone who later restyles the page.

Meaning versus appearance

HTML has pairs of elements that look the same by default but mean different things:

  • <strong> marks text of strong importance, such as a warning. <b> draws attention to text without extra importance, like a product name in a review.
  • <em> adds stress emphasis that changes how a sentence is spoken. <i> marks text in an alternate voice, such as a foreign word, a technical term or a ship's name.

Say these sentences out loud: "I never said that" changes meaning with emphasis, so it uses <em>. In "The word jugaad has no direct English equivalent", the word jugaad belongs in <i> because it is a foreign term, not stressed speech.

The formatting elements at a glance

ElementMeaningDefault look
<strong>Important, serious or urgentBold
<b>Draws attention, no extra importanceBold
<em>Stress emphasisItalic
<i>Alternate voice or termItalic
<mark>Highlighted for relevance, like search matchesYellow background
<small>Side comments and fine printSmaller text
<del> / <ins>Removed and added textStrikethrough / underline
<s>No longer accurate, but not an editStrikethrough
<sub> / <sup>Subscript and superscriptLowered / raised

Formatting in a real paragraph

<p>
  <strong>Warning:</strong> unplug the device before cleaning.
</p>
<p>
  Price: <s>Rs 999</s> Rs 799 <small>(taxes extra)</small>
</p>
<p>
  Water is H<sub>2</sub>O and the area of a square is a<sup>2</sup>.
</p>
<p>
  Meeting moved to <del>Monday</del>
  <ins>Tuesday</ins>.
</p>
<p>Results for "grid": CSS <mark>grid</mark> layout basics</p>

The old price uses <s> because it is no longer accurate, not because a document was edited. The meeting change uses <del> and <ins>, which can carry a datetime attribute recording when the edit happened.

Nesting formatting elements

You can combine elements, for example <strong><em>Do not</em></strong> for text that is both important and stressed. Nesting <strong> inside <strong> signals even greater importance. Close them in reverse order of opening.

Mistakes that undo the meaning

The biggest one is using formatting tags only for looks. Wrapping a whole paragraph in <b> to make it bold, or using <i> for every caption, gives no useful meaning and is harder to change later. If you only want a visual style, use a CSS class such as font-weight: 700 instead. Another mistake is reaching for <u> to underline headings; underlined text looks like a link, which confuses users, and <u> is meant for things like marking spelling errors.

Also avoid the obsolete <font>, <center> and <big> elements found in very old tutorials. They are not part of modern HTML; CSS handles colour, size and alignment.

Rule of thumb

Ask what the text means before choosing a tag: important gets <strong>, stressed gets <em>, highlighted gets <mark>, edits get <del> and <ins>. When the goal is purely visual, write CSS rather than another formatting element.

Ready to master real-world web development?

Learn HTML, CSS3, Bootstrap and JavaScript hands-on with mentor-led sessions.

Explore Course