• Menu
  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

JavaBeat

Java Tutorial Blog

  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)
  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)

HTML5 Header Tag

March 12, 2014 //  by Krishna Srinivasan//  Leave a Comment

The <header> element is used to display the headers in html page. There are various heading element such as <hgroup> , < h1> to < h6> element. We can use headers by using <h1> to <h6> tag which defines font size according to header tags. Note that <hggroup> tag is removed from the HTML5 specification. We are not using that element in our example. <header> tag represents the group of navigator controls. This tag can be used multiple times in a document. Which leads to the over use of this tag multiple times where it can be reduced.

In short, <header> tag is used for grouping the collection of header tags like <h1> – <h6>. If you are using single formatting tag like <h1>, then there is no need to use header tag.

Syntax of <header> Tag

<header> Body content </header>

Browser Support

<header> element is supported in Internet Explorer 9, Firefox, opera, Chrome and safari browsers.

Example of <header> Tag

<!doctype html>
<head>
<meta charset="UTF-8">
<title>HTML 5 Example by JavaBeat.net</title>
</head>
<body>
<header>
<span style="color:brown;font-style:italic;">JavaBeat Version 1.0</span>
<hr>
</header>
<article>
  <h1>HTML5</h1>
  <div style="width:800px">
  <p style="text-align:justify">HTML5 is the latest standard for HTML.
   The previous version of HTML, HTML 4.01, came in 1999, and
   the internet has changed significantly since then.
   HTML5 was designed to replace both HTML 4, XHTML,
    and the HTML DOM Level 2.</p>
 </div>
<footer>
 <span style="color:brown;font-style:italic;">Copyright &copy;2014</span>
</footer>
</body>
</html>
  • <header> element is used to display the header in html page.

Example Application Test

  • Save the file as header_example.html in your system.
  • Just open the file in the browser, you will see the below picture in the browser. Note that the browser must support HTML5 specification.

Output

When the execution process is completed successfully we will get the following output :
HTML5 Header

Category: HTMLTag: HTML5

About Krishna Srinivasan

He is Founder and Chief Editor of JavaBeat. He has more than 8+ years of experience on developing Web applications. He writes about Spring, DOJO, JSF, Hibernate and many other emerging technologies in this blog.

Previous Post: « HTML5 Mark Tag
Next Post: HTML5 Footer Tag »

Reader Interactions

Leave a Reply Cancel 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.

Primary Sidebar

Follow Us

  • Facebook
  • Pinterest

FEATURED TUTORIALS

New Features in Spring Boot 1.4

Difference Between @RequestParam and @PathVariable in Spring MVC

What is new in Java 6.0 Collections API?

The Java 6.0 Compiler API

Introductiion to Jakarta Struts

What’s new in Struts 2.0? – Struts 2.0 Framework

JavaBeat

Copyright © by JavaBeat · All rights reserved
Privacy Policy | Contact