HTML Text Formatting

HTML provides a range of tags that can be used to format text on a web page.
Following is the list of HTML formatting text.
  • <b> - Text is Bold
  • <strong> - Text is Important
  • <mark> - Text is Marked
  • <i> - Text is Italic
  • <em> - Text is Emphasized
  • <big> - Text is bigger
  • <small> -Text is Smaller
  • <del> - Text is Deleted
  • <u> - Text is underlined
  • <ins> - Text is Inserted
  • <sub> - Text is Subscript
  • <sup> - Text is Superscript

HTML <b> Element

Used to make text bold.
You can use a style font-weight to make it bold.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Bold Text Example</title>
  </head>
  <body>
    <h1>Bold Text Example</h1>
    <p>Text becomes <b>bold</b></p>
  </body>
</html>

HTML <strong> Element

Used to indicate that the text is important.
A strong tag is the same as a bold tag.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Strong Text Example</title>
  </head>
  <body>
    <h1>Strong Text Example</h1>
    <p>Text becomes <strong>important and bold</strong></p>
  </body>
</html>

HTML <mark> Element

Used to make text highlighted.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Marked Text Example</title>
  </head>
  <body>
    <h1>Marked Text Example</h1>
    <p>Text becomes <mark>marked</mark></p>
  </body>
</html>

HTML <i> Element

Used to make the text italic.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Italic Text Example</title>
  </head>
  <body>
    <h1>Italic Text Example</h1>
    <p>Text becomes <i>italic</i></p>
  </body>
</html>

HTML <em> Element

Used to make text emphasized and italic.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Emphasized Text Example</title>
  </head>
  <body>
    <h1>Emphasized Text Example</h1>
    <p>Text becomes <em>emphasized</em></p>
  </body>
</html>

HTML <big> Element

Used to make text bigger than normal.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Big Text Example</title>
  </head>
  <body>
    <h1>Big Text Example</h1>
    <p>Text becomes <big>big</big></p>
  </body>
</html>

HTML <small> Element

Used to make text smaller than normal.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Small Text Example</title>
  </head>
  <body>
    <h1>Small Text Example</h1>
    <p>Text becomes <small>small</small></p>
  </body>
</html>

HTML <del> Element

Used to indicate that a section of text has been deleted or removed from a document.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Deleted Text Example</title>
  </head>
  <body>
    <h1>Deleted Text Example</h1>
    <p>Text becomes <del>deleted</del></p>
  </body>
</html>

HTML <ins> Element

Used to indicate a section of text has been inserted or added to a html page.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Underlined Text Example</title>
  </head>
  <body>
    <h1>Underlined Text Example</h1>
    <p>The text is <u>underlined</u></p>
  </body>
</html>

HTML <u> Element

Used to underline a text.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Inserted Text Example</title>
  </head>
  <body>
    <h1>Inserted Text Example</h1>
    <p>The text in this section is <ins>inserted</ins></p>
  </body>
</html>

HTML <sub> Element

Used to make the text appear below the normal text in a smaller size.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Subscript Text Example</title>
  </head>
  <body>
    <h1>Subscript Text Example</h1>
    <p> O<sub>2</sub> - Oxygen </p>
  </body>
</html>

HTML <sup> Element

Used to make the text appear above the normal text in a smaller.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Superscript Text Example</title>
  </head>
  <body>
    <h1>Superscript Text Example</h1>
    <p>The Isotope of Hydrogen H<sup>1</sup></p>
  </body>
</html>

Quick Recap - Topics Covered

<b>, <stong> and <mark> tags
<i> and <em> tags
<big> and <small> tags
<del>, <ins> and <u> tags
<sup> and <sub> tags

Practice With Examples in Compilers

The Concepts and codes you leart practice in Compilers till you are confident of doing on your own. A Various methods of examples, concepts, codes availble in our websites. Don't know where to start Down some code examples are given for this page topic use the code and compile or Try on own Now

Example js

Example 1 Example 2 Example 3 Example 4 Example 5


Quiz


FEEDBACK

Rating


Message