Sunday, 20 September 2015

HTML Header Tag

HTML Header Tag

HTML <header> tag is used as a container of introductory content or navigation links. Generally a <header> element contains one or more heading elements, logo or icons or author's information.
You can use several <header> elements in one document, but a <header> element cannot be placed within a <footer>, <address> or another <header> element.

HTML Header Tag Example

  1. <header>  
  2. <h2>ABCOnline.com</h2>  
  3. <p> World's no.1 shopping website</p>  
  4. </header>  

Output:

ABCOnline.com

World's no.1 shopping website

Let's see another example of header tag with CSS code.
CSS Code:
  1. header{  
  2. border: 1px solid pink;  
  3. background-color:pink;  
  4. padding:10px;  
  5. border-radius:5px;  
  6. }  
HTML Code:
  1. <header>  
  2. <h2>ABCOnline.com</h2>  
  3. <p> World's no.1 shopping website</p>  
  4. </header>  

Output:

ABCOnline.com

World's no.1 shopping website

No comments:

Post a Comment