HTML 5 – Some important formatting elements

In this blog explains few important formatting elements of HTML 5 with real time examples.

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 the 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>  
  9.             <em> Hi. This is Raj Kumar Beniwal Here (This is normal text) </em>  
  10.         </p>  
  11.     </body>  
  12. </html>     
Output: 
 
j
  
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   
  8.             <mark>Raj Kumar</mark> Beniwal Here.   
  9.         </h2>  
  10.     </body>  
  11. </html>    
Output:
 
h
 
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   
  8.             <small>Raj Kumar</small> Beniwal Here.   
  9.         </h1>  
  10.     </body>  
  11. </html>     
Output:
 
g
 
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   
  8.             <del>Raj Kumar</del> Beniwal Here.   
  9.         </h1>  
  10.     </body>  
  11. </html>    
Output:
 
f
 
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   
  8.             <ins>Kumar</ins> Beniwal here.    
  9.         </h1>  
  10.     </body>   
Output:
 
d
 
6. Subscripts text– The syntax of the 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   
  8.             <sub>Raj Kumar</sub> Beniwal here.    
  9.         </h1>  
  10.     </body>  
  11. </html>     
Output:
 
s
 
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   
  8.             <sup>Raj Kumar</sup> Beniwal here.    
  9.         </h1>  
  10.     </body>  
  11. </html>     
Output:
 
a