Style Tags in HTML 5

Style tags in HTML 5

 
1. <b>:- This tag is used to display a text in bold in the HTML document.
 
Syntax:
 
<b> Text you want to display in bold </b>

Code:      
  1. <!DOCTYPE HTML>  
  2. <html>  
  3.     <body>  
  4.         <p> I m   
  5.             <b> b </b> tag   
  6.         </p>  
  7.     </body>  
  8. </html>             
Output:
 
     b.gif
          
      b.gif
  
2. <i>:- This tag is used to show text in italics in a document.
 
Syntax:
 
<i> Text you  want to show in italics </i>
 
Code:        
  1. <!DOCTYPE HTML>  
  2. <html>  
  3.     <body>  
  4.         <p> I m   
  5.             <i> i </i> tag   
  6.         </p>  
  7.     </body>  
  8. </html>     
Output:
 
 i.gif  
 
3. <pre>:- This tag is used to set formatting in such a way, that the way 
 
we write it, it will display in the browser in the same format. It will also include white space if you have included it while writing text in this tag. It doesn't do word wrap.
 
Syntax: 
 
<pre> A text you want to write which will display in same format in 
browser. </pre>
 
Code:
  1. <!DOCTYPE HTML>  
  2. <html>  
  3.     <body>  
  4.         <p>  
  5.             <pre> This tag is used to set formatting in a way </pre>  
  6.         </p>  
  7.     </body>  
  8. </html>  
Output:
 
 pre.gif
 
4. <small>:- This tag is used to display text in small in a browser.
 
Syntax:
 
<small> A text you want to display in small </small>
 
Code:   
  1. <!DOCTYPE HTML>  
  2. <html>  
  3.     <body>  
  4.         <p>  
  5.             <small> I m </small>  
  6.             <b>    
  7.    small</b>  
  8.             <i> tag </i>  
  9.         </p>  
  10.     </body>  
  11. </html>   
Output:
 
small.gif
 
5. <style>:- We can use this tag to provide some style to our document. We can use color attribute with it to differentiate normal paragraphs and main heading in our document.
 
Syntax:
 
<style type=type of text you want. It can contain values text or CSS.> 
 After that a tag on which you want to define an attribute: an attribute
 value}</style>
 
Code:
  1. <!DOCTYPE HTML>  
  2. <html>  
  3.     <head>  
  4.         <style type="text/css">  
  5.    h1 { color:Purple}  
  6.    h2 { color:Orange}   
  7.    </style>  
  8.     </head>  
  9.     <body>  
  10.         <h1> I m style tag </h1>  
  11.         <h2> I provide style to document </h2>  
  12.     </body>  
  13. </html>   
Output:
 
style.gif    
Next Recommended Reading Importance of Form Tag in HTML Page