Menu

Text Formatting

Text Formatting

HTML gives you several tags to change how text looks or to hint at its meaning. These aren't the same as CSS styling, since they also carry semantic meaning, but they do have default visual effects.

strong makes text bold and tells the browser this text is important. em makes text italic and tells the browser this text should be emphasized. Tags like <mark> for highlighting and <small> for fine print also exist.

<p>This is <strong>very important</strong> and this is <em>emphasized</em>.</p>

<p>Use the code <mark>console.log()</mark> to debug.</p>

<p><small>Terms and conditions apply.</small></p>

Explanation:

  • strong and em are preferred over the older b and i tags because they describe meaning, not just appearance.
  • mark highlights text with a yellow background by default, useful for drawing attention to a specific word or phrase.

HTML Tutorial (From Basics to Implementation)

AP

Abhishek Pati





Get in Touch For Details