Skip to main content
Practice

h Tag

The <h> tags, defined from <h1> to <h6>, specify the heading elements of a document.

h tags help in shaping the hierarchical structure of a webpage and indicating the importance of content.

<h1> represents the most important, high-level large heading, while <h6> denotes the least important, low-level small heading.

For example, the h1 tag can be used as shown below.

h1 Tag Example
<h1>Hello World</h1>

The above HTML code example displays "Hello World" as the highest level heading. The opening tag <h1> indicates the start of a large heading, and the closing tag </h1> indicates the end of the large heading.

Note that HTML tag names are case-insensitive, so <h1> and <H1> are recognized as the same by web browsers.

However, it is generally a convention to write tags in lowercase, so it is recommended to write <h1> instead of <H1>.

For search engine optimization (SEO), it is best to use only one h1 tag per webpage.


Follow the highlighted parts of the code and practice inputting them.

Want to learn more?

Join CodeFriends Plus membership or enroll in a course to start your journey.