Paragraphs and Text Formatting
After headings, paragraphs are the most-used HTML element. HTML also provides many text formatting tags: bold, italic, highlighted, subscript, superscript, deleted text, and more.
Paragraphs vs Line Breaks
<!-- p creates a full block with space before and after --> <p>HTML is the foundation of every website.</p> <p>CSS makes HTML beautiful with colors and fonts.</p> <!-- br is a line break WITHIN a block --> <p> First line of an address.<br/> Second line, same city.<br/> Pin code: 110001 </p>
HTML is the foundation of every website.
CSS makes HTML beautiful with colors and fonts.
First line of an address.
Second line, same city.
Pin code: 110001
Text Formatting Tags
<!-- strong = bold WITH semantic importance --> <p>Always put <strong>charset=UTF-8</strong> first in head.</p> <!-- em = italic WITH semantic emphasis --> <p>The word <em>semantic</em> means "meaningful".</p> <!-- mark = highlighted text --> <p>The answer is <mark>HTML5</mark>.</p> <!-- sub and sup: H2O and E=mc2 --> <p>Water is H<sub>2</sub>O and E=mc<sup>2</sup></p> <!-- del and ins: price updates --> <p>Price: <del>Rs.500</del> <ins>Rs.299</ins></p> <!-- code: inline code snippets --> <p>Use <code>console.log()</code> to debug.</p>
Always put charset=UTF-8 first in head.
The word semantic means "meaningful".
The answer is HTML5.
Water is H2O and E=mc2
Price: Rs.500 Rs.299
Use console.log() to debug.
Blockquote and Pre
<blockquote> The best time to start learning was yesterday. The second best time is right now. <footer>— Shiva Saini, CIWeb</footer> </blockquote> <pre>This text preserves spaces and line breaks exactly.</pre>
The best time to start learning was yesterday. The second best time is right now.
This text
preserves spaces
and line breaks exactly.
<strong> has semantic meaning — screen readers announce it with added emphasis. Search engines treat it as important content. <b> only adds visual boldness with zero semantic meaning. Always prefer <strong> when the text is genuinely important.
HTML collapses all whitespace — multiple spaces and newlines become one space. This was intentional: write and indent HTML however you like without affecting the output. Use <br/> for line breaks and CSS for spacing.