Saturday , February 23 2019

HTML Header Tag, Syntax, Example

The HTML Header Tag is a group of introductory content or navigation links. It contains on most important heading tags, <h1> to <h6>, logo and author information etc.

A <header> element may place within the <body> element. You refrain to put it in the <footer>, <address> or <header> element. It is also referred as <header> element.

Read: what is HTML (Hypertext Markup Language)?

Read: Complete HTML Tags List

 

Syntax:

<body>

<header>

<img src=”logo.png” alt=”Logo”>

</header>

</body>

HTML Header Tag Example:

<!DOCTYPE html>

<html>

<head>

<meta charset=”UTF-8″>

<title>HTML by Khyber Academy</title>

</head>

<body>

<header>

<img src=”/images/logo.png” alt=”Logo”>

</header>

<article>

<h1> Heading for article</h1>

<p> Text under articles </p>

</article>

</body>

</html>

Attributes:

Three types of attributes can add to header tag,

  • Global Attributes
  • Event Handler Content Attributes
  • Element Attributes

HTML Header Tag CSS Default Setting:

Header element has the following default CSS value.

header {

display: block;

}

Browsers Support:

Following is the specification of the first browser version which support the header tag.

  • Inter Explorer 9.0
  • Google Chrome 6.0
  • Firefox 4.0
  • Safari 5.0
  • Opera 11.1

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.