HTML 5 – Some important formatting elements

Following are the list of formatting elements:

  •      Emphasized text
  •      Marked text
  •      Small text
  •      Deleted text
  •      Inserted text
  •      Subscripts
  •      Superscripts

 1. Emphasized text– The syntax of Emphasized text element is <em> which defines emphasized text.

Example:

  1. <!DOCTYPE html>  
  2. <html>  
  3. <head>  
  4. <title>HTML formatting element sample</title>  
  5. </head>  
  6. <body>  
  7. <p>Hi. This is Raj Kumar Beniwal Here (This is normal text) </p>  
  8. <p><em> Hi. This is Raj Kumar Beniwal Here (This is normal text) </em> </p>  
  9. </body>  
  10. </html>  

Output: 

 2. Marked text– The syntax of marked text element is <mark> which defines marked or highlighted text.

Example:

  1. <!DOCTYPE html>  
  2. <html>  
  3. <head>  
  4. <title>HTML formatting element sample</title>  
  5. </head>  
  6. <body>  
  7. <h2>Hi. This is <mark>Raj Kumar</mark> Beniwal Here. </h2>  
  8. </body>  
  9. </html>  
Output:

 3.    Small text– The syntax of small text element is <small> which defines small text.
Example: 
  1. <!DOCTYPE html>  
  2. <html>  
  3. <head>  
  4. <title>HTML formatting element sample</title>  
  5. </head>  
  6. <body>  
  7. <h1>Hi. This is <small>Raj Kumar</small> Beniwal Here. </h1>  
  8. </body>  
  9. </html>  
Output:

 4.    Deleted text– the syntax of deleted text is <del> which defines deleted or removed text.
Example: 
  1. <!DOCTYPE html>  
  2. <html>  
  3. <head>  
  4. <title>HTML formatting element sample</title>  
  5. </head>  
  6. <body>  
  7. <h1>Hi. This is <del>Raj Kumar</del> Beniwal Here. </h1>  
  8. </body>  
  9. </html>  
Output:

 5.    Inserted text– the syntax of inserted text element is <ins> which defines inserted or added text.
Example:
  1. <!DOCTYPE html>  
  2. <html>  
  3. <head>  
  4. <title>HTML formatting element sample</title>  
  5. </head>  
  6. <body>  
  7. <h1>Hi. This is Raj <ins>Kumar</ins> Beniwal here.  </h1>  
  8. </body>   
Output:

 6.    Subscripts text– The syntax of subscripts text element is <sub> which defines subscripted text.
Example: 
  1. <!DOCTYPE html>  
  2. <html>  
  3. <head>  
  4. <title>HTML formatting element sample</title>  
  5. </head>  
  6. <body>  
  7. <h1>Hi. This is <sub>Raj Kumar</sub> Beniwal here.  </h1>  
  8. </body>  
  9. </html>  
Output:

 7.    Superscripts text– The syntax of superscript text element is (sup> which defines superscripted text.
Example:
  1. <!DOCTYPE html>  
  2. <html>  
  3. <head>  
  4. <title>HTML formatting element sample</title>  
  5. </head>  
  6. <body>  
  7. <h1>Hi. This is <sup>Raj Kumar</sup> Beniwal here.  </h1>  
  8. </body>  
  9. </html>  
Output:


Ebook Download
View all
Learn
View all