Skip to content
Related Articles

Related Articles

Improve Article

How to define an HTML heading in HTML5 ?

  • Last Updated : 24 Mar, 2021

An HTML heading tag is used to define headings of a page. Headings are defined with the <h1> to <h6> tags. The size of the text depends upon the type of heading tag. h1 is the largest heading tag and h6 is the smallest one (h1 > h2 > h3 > h4 > h5 > h6).



Example 1:


<!DOCTYPE html>
  <h1>Welcome to GeeksforGeeks </h1>
  <h2>A computer science portal for geeks</h2>


Example 2: Each HTML heading has a default size, but user can change its size as given below.


<!DOCTYPE html> 
  <h1 style="font-size:40px;">
     Welcome to GeeksforGeeks


Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :