h Tag
The <h>
tag, defined from <h1>
to <h6>
, specifies the heading elements of a document.
h tags form the hierarchical structure of a web page and are used to indicate the importance of content.
<h1>
represents the most important, high-level heading, while <h6>
represents the least important, small heading.
For instance, the h1 tag
can be used as follows:
<h1>Hello</h1>
The above HTML code example displays the highest level heading "Hello". The start tag <h1>
signifies the beginning of a large heading, and the end tag </h1>
signifies the end of the large heading.
Note that tag names are not case-sensitive. Therefore, <h1>
and <H1>
are recognized as the same by web browsers.
However, it is customary to write tags in lowercase, so it is recommended to write <h1>
instead of <H1>
.
For search engine optimization (SEO), it is best to include only one h1 tag per web page.
Follow the emphasized portions of the code and try inputting it yourself.
Want to learn more?
Join CodeFriends Plus membership or enroll in a course to start your journey.