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
This is bold text using the b tag.
This is strongly emphasized text using the strong tag.
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.
This is italicized text using the i tag.
This is emphasized text using the em tag.
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.
This is struck-through text using the s tag.
This is deleted text using the del tag.
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
To learn more about HTML, you should focus on the basic structure of a webpage.
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.
This text is bold using CSS.
This text is italicized using CSS.
This text is underlined using CSS.
This text is struck-through using CSS.
Water is represented as H2O.
E=mc2