HTML5ANDCSS3 logoHTML5ANDCSS3Tools and Tutorials
  • Insights
  • Verify Certificate
HTML5ANDCSS3 logoHTML5ANDCSS3Tools and Tutorials
HTML5ANDCSS3 logoHTML5ANDCSS3Tools and Tutorials

HTML5andCSS3.org helps developers learn modern frontend skills with practical tutorials, production-ready snippets, and fast web tools built for everyday coding.

Quick Links

  • About Us
  • Contact Us
  • Privacy Policy
  • Copyright
  • Disclaimer

Top Tools

  • Try It Editor
  • JSON Formatter
  • CSS Minifier
  • HTML Minifier
  • Base64 Encoder / Decoder

Contact

  • business@html5andcss3.org
Newsletter

Learn at your own pace, practice with useful tools, and build websites you're proud of.

© 2011-2026 html5andcss3.org. All rights reserved.

How to Use

HTML Tutorial

HTML Basics

Introduction to HTMLHTML EditorsHTML StructureHTML Elements & AttributesHTML HeadingsHTML ParagraphsHTML FormattingHTML CommentsHTML Styles

HTML Text and Links

HTML Text FormattingHTML Quotations & CitationsHTML LinksHTML Email Links

HTML Lists and Tables

HTML ListsHTML TablesTable Styling & Borders

HTML Images and Media

HTML ImagesHTML Picture ElementHTML AudioHTML VideoHTML Embed & Object

HTML Forms

HTML Forms OverviewHTML Form ElementsHTML Input TypesHTML Input AttributesHTML Form AttributesHTML Form Validation

HTML Layout

HTML Block vs Inline ElementsHTML Div & SpanHTML Semantic Layout TagsHTML Iframes

Advanced HTML

HTML Entities & SymbolsHTML EmojisHTML Head Element TagsHTML Meta Tags for SEOHTML Responsive Design

HTML References

HTML5 New TagsDeprecated TagsHTML Global AttributesEvent AttributesComplete HTML Tag ListComplete HTML5 ElementsHTML Tutorial PDF
  1. Home
  2. /
  3. Tutorials
  4. /
  5. HTML Tutorial
  6. /
  7. HTML Text Formatting

HTML Text and Links

HTML Text Formatting

HTML Text Formatting allows you to enhance and style text to emphasize meaning, highlight important parts, and improve readability.
It combines basic formatting tags with semantic and accessible design to make content look more professional and meaningful.

What Is Text Formatting in HTML?

Text formatting means changing the appearance or meaning of text using HTML tags.

For example, you can make text bold, italic, underlined, marked, or smaller to draw attention or clarify meaning.

Text Formatting Example

html

<p>This is <b>bold</b> and <i>italic</i> text.</p>

Commonly Used Text Formatting Tags

TagDescriptionExample
<b>Makes text bold (visual only)Bold text
<strong>Emphasizes important text (semantic)Important!
<i>Italic text (visual only)Italic text
<em>Emphasized text (semantic meaning)Emphasized text
<u>Underlined textUnderlined
<mark>Highlights textHighlighted text
<small>Makes text smallerFine print
<del>Shows deleted textOld price
<ins>Shows inserted text<ins>New price</ins>
<sub>Subscript textH2O
<sup>Superscript textx2

Combining Multiple Formatting Tags

You can mix several formatting styles together to achieve rich text presentation.

Multiple Formatting Example

html

<p>This <b><i><mark>text</mark></i></b> is bold, italic, and highlighted.</p>

Preformatted & Code Text

When displaying code snippets or preserving spaces and line breaks, HTML provides two special tags:

<pre> Tag

Pre Tag Example

html

<pre>
Line 1
  Line 2 (Indented)
    Line 3
</pre>

<code> Tag

Displays text as computer code:

Code Tag Example

html

<code>console.log("Hello World");</code>

Combined <pre> and <code> Tag

Combined Example

html

<pre><code>function greet() { console.log("Hello!"); }</code></pre>

Accessibility and Best Practices

  • Use <strong> and <em> for meaning, not just style.
    Example: <strong> for important text, <em> for emphasis.
  • Avoid using <b> and <i> alone unless for visual presentation only.
  • Combine CSS for visual styling instead of relying entirely on HTML tags.

Example

html

<p style="font-weight: bold; color: #29AB87;">Styled with CSS</p>

Practical Example: Product Description

Practical Example

html

<h2>Smart Watch Features</h2>
<p>
  The <strong>new SmartTime X</strong> comes with a 
  <em>heart rate monitor</em> and <mark>GPS tracking</mark>.
  Battery lasts for <b>7 days</b> and is <u>water-resistant</u>.
</p>
<p>
  Old price: <del>$199</del>  
  New price: <ins>$149</ins>
</p>

Demonstrates semantic, visual, and practical formatting in real-world content.

Browser Support

Chrome
Edge
Firefox
Safari
Opera
IE9+
YesYesYesYesYesYes

Conclusion

HTML Text Formatting helps you create readable, attractive, and accessible web pages.
By combining formatting tags smartly with CSS and semantics, you can emphasize key information while maintaining a professional look.

PreviousHTML StylesNextHTML Quotations & Citations