HTML Text Formatting
Text formatting in HTML uses tags to give structure and meaning to text. Two main categories: semantic (<strong>, <em>) add meaning and are preferred for accessibility; presentational (<b>, <i>, <u>) only change appearance. Use semantic tags when you want to convey importance or emphasis; use CSS (e.g. <span class="...">) for pure style.
Common tags
<strong> = strong importance. <em> = emphasis. <b> = bold. <i> = italic. <u> = underline. <s> = strikethrough. <mark> = highlighted (e.g. search results).
Best practices
Prefer <strong> over <b> and <em> over <i> when the content has real importance or emphasis. Screen readers and search engines use this. For visual-only styling, use CSS.
