Learn HTML

"Are you looking to learn HTML from scratch? Look no further! Our HTML course is designed for both beginners and advanced learners who want to master the fundamental concepts of HTML. Our comprehensive course covers everything from the basic concepts of HTML, including tags, attributes, and elements, to the more advanced concepts such as multimedia, responsive design, and accessibility."

HTML Text Formatting

HTML text formatting is used to apply various formatting styles to the text on a web page. HTML allows you to format your text in various ways to make it more visually appealing and organized. Here are list of the most common text formatting elements used in HTML:

  • <b> and <strong> for bold text
  • <i> and <em> for italic text
  • <u> for underline text
  • <s> and <del> for strikethrough text
  • <sub> and <sup> for subscript and superscript text
  • <small> and <big> for smaller and bigger text
  • <pre> for preformatted text
  • <code> for computer code
  • <kbd> for keyboard input
  • <samp> for sample output
  • <var> for variables
  • <cite> for citations
  • <q> and <blockquote> for quotations
  • <abbr> for abbreviations
  • <dfn> for definitions
  • <mark> for marked or highlighted text
  • <address> for contact information
  • <bdo> for Bi-Directional Override

Some of the following are some examples of text formatting in HTML:


Bold Text

The <b> and <strong> tag is used to make text bold. 

The <strong> element is for content that is of greater importance, while the <b> element is used to draw attention to text without indicating that it's more important.

For Example:

<p>This is <b>bold text</b>.</p>


Italic Text

The <i> and <em> tag is used to make text italic. 

The <i> tag is used to indicate text in a different style, typically in italics, without conveying any additional importance or emphasis to the content. It is primarily used for presentational purposes.

The <em> tag, on the other hand, is used to mark text that has emphasis or importance within the context of its surrounding content. It is typically rendered as italicized text, but its main purpose is to convey meaning rather than style.

For Example:

<p>This is <i>italic text</i>.</p>


Underlined Text

The <u> tag is used to underline text. For Example:

<p>This is <u>underlined text</u>.</p>


Strikethrough Text

The <s> or <strike> tags are used to add a strikethrough effect to text. For Example:

<p>This is <s>strikethrough text</s>.</p>


Superscript and Subscript Text

The <sup> and <sub> tags are used to create superscript and subscript text, respectively. For Example:

<p>This is <sup>superscript text</sup> and this is <sub>subscript text</sub>.</p>


Small Text

The <small> tag is used to make text smaller. For Example:

<p>This is <small>small text</small>.</p>


Marked Text

The <mark> tag is used to highlight text. For Example:

<p>This is <mark>marked text</mark>.</p>



The <blockquote> tag is used to indicate a section of text that is a quotation. Here's an example. For Example:

 <p>This is a quotation.</p>

In this example, the text within the <blockquote> element is displayed with an indentation and typically some form of visual emphasis (e.g. italicized or surrounded by quotation marks) to distinguish it from the surrounding text.



The <q> element is used to indicate a short inline quotation. Here's an example. For Example:

<p>The author said, <q>This is a short quotation.</q></p>

In this example, the text within the <q> element is typically displayed surrounded by quotation marks.


These are just a few examples of the text formatting tags available in HTML. There are many more, and you can also combine them to achieve different effects. Keep in mind that while these tags are useful for formatting text, you should also use CSS to style text and other elements on your web page.


Watch this chapter video on YouTube: