Previous Next

HTML Formatting


 

HTML Bold Text

The HTML <b> element defines bold text.

Example

<!DOCTYPE html>
<html>
   <head>
      <title>Bold Text Example</title>
   </head>
   <body>
      <p>This is <b>bold</b> text.</p>
   </body>
</html>

Result

This is a bold text.


 

HTML Italic Text

The HTML <i> element defines italic text.

Example

<!DOCTYPE html>
<html>
   <head>
      <title>Italic Text Example</title>
   </head>
   <body>
      <p>This is <i>italicized</i> text.</p>
   </body>
</html>

Result

This is italicized text.


 

HTML Underlined Text

The HTML <u> element defines  underlined text.

Example

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

Result

This is underlined text.


 

HTML Striked Text

The element <strike>  defines strike text.

Example

<!DOCTYPE html>
<html>
   <head>
      <title>Strike Text Example</title>
   </head>
   <body>
      <p>This is <strike>strikethrough</strike> text.</p>
   </body>
</html>

Result

This is strikethrough text.


 

HTML Monospaced Font

The element <tt> defines monospaced text.

The monospaced fonts have the same width, while other fonts have variable widths. 

Example

<!DOCTYPE html>
<html>
   <head>
      <title>Monospaced Font Example</title>
   </head>
   <body>
      <p>The following word uses a <tt>monospaced</tt> typeface.</p>
   </body>
</html>

Result:

This text is monospaced.


 

HTML Superscript Text

The element <sup> defines superscript text.

The font size used is the same size as the characters surrounding it.

It is displayed half a character's height above the other characters.

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>

Result:

This is a superscript text.


 

HTML Subscript Text

The element <sub> defines superscript text.

The font size used is the same size as the characters surrounding it.

It is displayed half a character's height below the other characters.

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>

Result:

The is a  subscript text.


 

HTML Inserted Text

The element <ins> defines inserted text.

Example

<!DOCTYPE html>
<html>
   <head>
      <title>Inserted Text Example</title>
   </head>
   <body>
      <p>I want to drink <del>cola</del> <ins>wine</ins></p>
   </body>
</html>

Result:

This is inserted text.


 

HTML Deleted Text

The element <del> defines deleted text.

Example

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

Result:

This is a deleted text.


 

HTML Larger Text

The element <big> defined big text.

The big texts are one font larger than the surrounding text.

Example

<!DOCTYPE html>
<html>
   <head>
      <title>Larger Text Example</title>
   </head>
   <body>
      <p>The following word uses a <big>big</big> typeface.</p>
   </body>
</html>

Result:

This is big text.


 

Smaller Text

The element <small> defines a smaller text.

The smaller texts are one font smaller than surrounding text.

Example

<!DOCTYPE html>
<html>
   <head>
      <title>Smaller Text Example</title>
   </head>
   <body>
      <p>The following word uses a <small>small</small> typeface.</p>
   </body>
</html>

Result:

This is smaller text.


The HTML Marked Text

 
The element <mark> defines marked text.

Example

<!DOCTYPE html>
<html>
   <head>
      <title>Marked Text Example</title>
   </head>
   <body>
      <p>The following word uses a <mark>marked</mark> text.</p>
   </body>
</html>

Result

This is marked text. 
 

Previous Next