Advertisement
Google Ad Slot: content-top
Formating
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.
Common Formatting Tags in HTML
-
Bold Text
-
Strong Text
-
Italic Text
-
Emphasized Text
-
Underlined Text
-
Strike Text
-
Deleted Text
-
Superscript Text
-
Subscript Text
-
Preformatted Text
-
Small Text
-
Marked Text
Bold and Strong Text: <b> and <strong>
<b>: Makes text bold without implying any special importance.<strong>: Makes text bold and also indicates that the text has strong importance
Italic and Emphasize Text: <i> and <em>
<i>: Makes text italicized without implying emphasis.<em>: Makes text italicized and also indicates that the text has emphasized importance.
Underline Text: <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.
Strikethrough and Delete Text: <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.
Superscript and Subscript: <sup> and <sub>
<sup>: Displays text as superscript (above the baseline).<sub>: Displays text as subscript (below the baseline).
Preformatted Text: <pre>
<pre>: Displays text with preserved formatting, including spaces and line breaks.
Small Text: <small>
<small>: Displays text in a smaller size.
Mark Text: <mark>
<mark>: Highlight or emphasize text by marking it with a visual cue, such as a background color
Modern Approach: Using CSS for Styling
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.