Formatting


Formatting

HTML formatting is the process of enhancing the appearance and feel of the text. HTML allows us to format text without having to use CSS. HTML has a lot of formatting tags. Text can be bolded, italicized, or underlined with these tags. In HTML and XHTML, there are nearly 14 alternatives for how the text looks.

The formatting tags in HTML are divided into two groups:

  • Physical tags: These tags are used to give the text a visual look.
  • Logical tag: These tags are used to provide the text with a logical or semantic value.

Formatting elements help us to declare texts in different formats.

The elements are as follows:

  • Bold text- < b > : Used to print text in a bold format without any importance.

  • Strong- < strong > : Used to print text in bold format with importance.
  • Italic text- < i > : Used to print text in italic format.
  • Emphasized text- < em > : Used when text has to be emphasized, which means the text will be read using verbal stress.
  • Smaller text- < small > : Used to print text in small size.
  • Larger text- < big > : Used to print text in large size.
  • Marked text- < mark > : Used to print text in highlighted or marked manner.
  • Deleted text- < delete > : Used to print text that has to be deleted.
  • Subscript text- < sub > : Used to print text below the normal line. It can be used to write chemical formulas.
  • Superscript text- < sup > : Used to print text above the normal line.
  • Inserted text- < ins > : Used to insert text in an existing statement.
  • Monospaced text- < tt > : Used to print text in equal spaces.

Example No.1:

<html> <body> <p><b>Knowledge2life</b></p> <p><i>online learning</i></p> <p>Website<sub> Knowledge2life</sub> </p> </body> </html>

OUTPUT:

Knowledge2life
online learning
Website Knowledge2life

Example No.2:

<html> <body> <p><b>Knowledge2life</b></p> <p><i>online learning</i></p> <p>Website<> Knowledge2life</sub> </p> </body> </html>

OUTPUT:

Knowledge2life
online learning
Website Knowledge2life