HtmlCssMonk

Formatting in HTML | Learn Basic HTML

DESCRIPTION

HTML Formatting is used to format the text in HTML without using CSS for better look and feel.

Some basic HTML formatting tags are given below –

  • <b> – Bold text
  • <strong> – Important text
  • <i> – Italic text
  • <em> – Emphasized text
  • <mark> – Marked text
  • <small> – Smaller text
  • <del> – Deleted text
  • <ins> – Inserted text
  • <sub> – Subscript text
  • <sup> – Superscript text

Bold Text

<b>….</b> Any text that comes between these tags is displayed in bold letters.

EXAMPLE

<!DOCTYPE html>
<html>

   <head>
      <title>Bold Text</title>
   </head>
	
   <body>
      <p>This Website is known as <b>html-css monk</b></p>
   </body>
	
</html>

This code will produce the following result –

This Website is known as html-css monk

NOTE<strong>…</strong> tag is same as <b>…</b> tag.


Italic Text

<i>….</i> Any text that comes between these tags is displayed in italicized letters.

EXAMPLE

<!DOCTYPE html>
<html>

   <head>
      <title>Italic Text</title>
   </head>
	
   <body>
      <p><i>Muhammad Ali</i> is the greatest of all time.</p>
   </body>
	
</html>

This code will produce the following result –

Muhammad Ali is the greatest of all time.

NOTE<em>..</em> tag is same as <i>..</i> tag.


Smaller Text

<small>….</small> Any text that comes between these tags is displayed in smaller letters.

EXAMPLE

<!DOCTYPE html>
<html>

   <head>
      <title>Smaller Text</title>
   </head>

   <body>
      <p>The following word uses a <small>small</small> typeface.</p>
   </body>

</html>

This code will produce the following result –

The following word uses a small typeface.

<big>….</big> Any text that comes between these tags is displayed in larger letters.


Superscript Text

<sup>….</sup> Any text that comes between these tags is displayed in superscript.

EXAMPLE

<!DOCTYPE html>
<html>

   <head>
      <title>Superscript Text Example</title>
   </head>
	
   <body>
      <p>The following word uses a <sup>superscript</sup> typeface.</p>
   </body>
	
</html>

This code will produce the following result –

The following word uses a superscript typeface.

Subscript Text

<sub>…</sub> Any text that comes between these tags is displayed in subscript.

EXAMPLE

<!DOCTYPE html>
<html>

   <head>
      <title>Subscript Text Example</title>
   </head>
	
   <body>
      <p>The following word uses a <sub>subscript</sub> typeface.</p>
   </body>
	
</html>

This code will produce the following result –

The following word uses a subscript typeface.

Deleted Text

<del>…</del> Any text that comes between these tags is displayed as deleted text.

EXAMPLE

<!DOCTYPE html>
<html>

   <head>
      <title>Deleted Text Example</title>
   </head>
	
   <body>
      <p>I want to drink <del>cola</del></p>
   </body>
	
</html>

This code will produce the following result –

I want to drink cola 

Next topic – Images of HTML

Previous topic – Basics of HTML


Leave a Comment

Your email address will not be published. Required fields are marked *