Home >>HTML Tutorial >HTML Formatting

HTML Formatting

HTML Formatting

HTML Formatting provides different types of text tags for better look and feel without using CSS.

There are many formatting tags in HTML.

  1. <i> - Italic text
  2. <em> - Emphasized text
  3. <b> - Bold text
  4. <strong> - Important text
  5. <mark> - Marked text
  6. <small> - Small text
  7. <ins> - Inserted text
  8. <del> - Deleted text
  9. <sub> - Subscript text
  10. <sup> - Superscript text

HTML text Italic or Emphasized

The HTML text italic and emphasized text both are used to define italic text but the difference is emphasized tag added semantic importance to make the text italic. Both tags are need an opening tag and closing tag.

Let's take an example of HTML Italic or Emphasized:

<!DOCTYPE html>
<html>
<body>
<p>Normal text</p>
<p><i>This text is italic.</i></p>
<p><em>This text is emphasized.</em></p>
</body>
</html>
Output:

Normal text

This text is italic.

This text is emphasized.

HTML text bold or strong

The HTML bold and strong text both are used to highlight the text but the difference is strong tag added semantic importance to make the text strong. Both tags are need an opening tag and closing tag.

Let's take an example of HTML Text bold or strong:

<!DOCTYPE html>
<html>
<body>
<p>Normal text</p>
<p><b>This text is bold.</b></p>
<p><strong>This text is strong.</strong></p>
</body>
</html>
Output:

Normal text

This text is bold.

This text is strong.

HTML <mark> Element

HTML <mark> element is used to highlight and mark the text. It provides the yellow background color to the specified text.

Let's take an Example of <mark> element:

<!DOCTYPE html>
<html>
<body>
<p>Welcome to<mark>phptpoint</mark>.</p>
</body>
</html>
Output:

Welcome to phptpoint.

HTML <small> Element

HTML <small> element provides the smaller text. It also needs an opening and closing tag.

Let's take an Example of <small> element:

<!DOCTYPE html>
<html>
<body>
<p>It Provides <small>smaller</small> text</p>
</body>
</html>
Output:

It Provides smaller text.

HTML <ins> Element

HTML <ins> element helps to added/inserted a new text to the page. It also needs an opening tag and closing tag.

Let's take an Example of <ins> element:

<!DOCTYPE html>
<html>
<body>
<p>My Favorite place is <ins>Noida</ins></p>
</body>
</html>
Output:

My Favorite place is Noida

HTML <del> Element

HTML <del> Element is used to strike through the marking the part as deleted or removed text. It also needs an opening tag and closing tag.

Let's take an Example of <del> element:

<!DOCTYPE html>
<html>
<body>
<p>My Favorite place is <del>Noida</del> Delhi.</p>
</body>
</html>
Output:

My Favorite place is Noida Delhi.

HTML <sub> or <sup> Element

The <sub> or <sup> element is used to subscript or superscript a text. Subscript provide the specified text placed at the bottom of the text and Superscript provide the specified text placed at the top of the text.

Let's take an example of <sub> or <sup> Element:

<!DOCTYPE html>
<html>
<body>
<p>This is Normal Text : X2</p>
<p>This is subscript: X<sub>2</sub></p>
<p>This is superscript:X<sup>2</sup></p>
</body>
</html>
Output:

This is Normal Text : X2

This is subscript: X2

This is superscript: X2


No Sidebar ads