Headings in HTML

What are headings in HTML?

Heading elements in the HTML language are considered among the most important elements that need to be handled well. Heading elements consist of six levels. The maximum level is called h1 and the lowest level is called h6. These elements are also considered block elements that take up the entire width.

How to write heading tags on the editor?

Heading tags in HTML consist of the first letter and a number from one to six. The number determines the font size. The smaller the number, the larger the font. The number stops at six.

For example:

<body>
<h1>Title</h1>
<h2>Title</h2>
<h3>Title</h3>
<h4>Title</h4>
<h5>Title</h5>
<h6>Title</h6>
</body>

How does the editor handle missing heading elements such as h7 or h8?

If incorrect elements are written, the elements are ignored and only the words are counted

How do you write headings and subheadings in HTML?

The main title is often created using H1, and for the sub-headings, H2, H3, H4, H5, or H6 are used. These marks indicate heading levels.

For example:

<body>
<h1>Main Title</h1>
<h2>First subheading</h2>
<h3>Second sub-heading</h3>

<h1>Main Title</h1>
<h2>First subheading</h2>
<h3>Second sub-heading</h3>

<h1>Main Title</h1>
<h2>First subheading</h2>
<h3>Second sub-heading</h3>
</body>

An illustrative example:

<body>
<h1>Types of programming</h1>
<h2>Web Developer</h2>
<h3>front end</h3>
<h4>Learn HTML</h4>
<h4>Learn CSS</h4>
<h4>Learn JavaScript</h4>

<h3>back end</h3>
<h4>Learn PHP</h4>
<h4>Learn Python</h4>
<h4>Learn C#</h4>

<h2>Desktop Developer</h2>
<h3>Learn Java</h3>
<h3>Python</h3>
<h3>Learn C#</h3>

<h2>Application developer</h2>
<h3>Learn Java</h3>
<h3>Learn Swift</h3>
<h3>Learn JavaScript</h3>
</body>

Here we have finished explaining the heading elements of HTML. We’ll see you in the next lesson
Thank you for reading the article and don’t forget to share it with friends

Post Comment

You May Have Missed