top of page

HTML Basics (Headers)

Writer: Luna TechLuna Tech

Hi students,


In this section, we will discuss HTML headers.

The <header> tag in HTML is used to define the header for a document or a section as it contains the information related to the title and heading of the related content. The <header> element is intended to usually contain the section’s heading (an h1-h6 element or an <hgroup> element), but this is not required. It can also be used to wrap a section’s table of contents, a search form, or any relevant logos. The <header> tag is a new tag in HTML5 and it is a container tag. It contains a starting tag, content & the end tag. There can be several <header> elements in one document. This tag cannot be placed within a <footer>, <address> or another <header> element.


HTML defines six levels of headings.

  • <h1></h1>

  • <h2></h2>

  • <h3></h2>

  • <h4></h4>

  • <h5></h5>

  • <h6></h6>

The heading sizes are from largest to smallest.


  • <h1></h1> is the largest size.

  • <h6></h6> is the smallest size.

Heading tags go between the body tags because they appear on the webpage. A heading element implies all the font changes, paragraph breaks before and after, and any whitespace necessary to give the heading. You can make the heading any size you want with CSS (which you will learn about later).

Example:


 
 
 

Recent Posts

See All

HTML Basics (Comments)

Hi students, In this section, we will cover the importance of adding comments in your HTML code. One of the most important aspects of...

Comments


bottom of page