In HTML, formatting tags are used to style text and change its presentation. These tags are applied within text elements to adjust their appearance, such as making text bold, italicized, or underlined.
<b>
and <strong>
<b>
: Makes text bold without implying any special importance.<strong>
: Makes text bold and also indicates that the text has strong importanceTry it yourself
<i>
and <em>
<i>
: Makes text italicized without implying emphasis.<em>
: Makes text italicized and also indicates that the text has emphasized importance.Try it yourself
<u>
<u>
: Underlines text, which is typically used for indicating links. In modern HTML, its use for general text styling is discouraged in favor of CSS.<s>
and <del>
<s>
: Strikes through text to indicate that it is no longer accurate or relevant.<del>
: Indicates text that has been deleted from a document.Try it yourself
<sup>
and <sub>
<sup>
: Displays text as superscript (above the baseline).<sub>
: Displays text as subscript (below the baseline).Try it yourself
<pre>
<pre>
: Displays text with preserved formatting, including spaces and line breaks.Try it yourself
<small>
<small>
: Displays text in a smaller size.<mark>
<mark>
: Highlight or emphasize text by marking it with a visual cue, such as a background colorTry it yourself
While HTML formatting tags provide basic text styling, modern web development practices recommend using CSS for styling. CSS offers greater flexibility and control over the appearance of text and other elements.
Try it yourself