Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make new heading tag numbers such as h7, h8, etc.?

Tags:

html

How can I make another heading in HTML?

I have used <h1>, <h2>, <h3>, <h4>, <h5> and <h6>, and now I would like to add <h7> and <h8> as I have different text types that I need to use.

If you cannot do this, is there a way to call upon CSS sheets for text, other than <p> and <h1> - <h6>?

like image 350
Stonydallas Avatar asked Feb 16 '13 08:02

Stonydallas


People also ask

Is there h7 heading in HTML?

HTML defines six levels of headings. A heading element implies all the font changes, paragraph breaks before and after, and any white space necessary to render the heading. The heading elements are H1, H2, H3, H4, H5, and H6 with H1 being the highest (or most important) level and H6 the least.

Why there are only 6 heading tags and if we can create HTML tags h7 h8 and so on?

The HTML specification defines six headings. Browsers recognize six headings. If you start using <h7> and so on, then you'll be using an invalid element.

Which is the largest heading tag in HTML h1 h7 H5 h8?

<h1>–<h6>: The HTML Section Heading elements The <h1> to <h6> HTML elements represent six levels of section headings. <h1> is the highest section level and <h6> is the lowest.


1 Answers

You can declare this in your style sheet:

h7, h8, h9 { /* You can just go on adding headings */
   display: block; /* Because this is a block level element */
}

h7 {
   font-size: /* Whatever */ ;
}

h8 {
   font-size: /* Whatever */ ;
}

But I would suggest you not to do so, as it doesn't carry any semantic meaning. Also it will be bad from a SEO point of view.

Also take a look at html5shiv. Just add the elements you want in the script.

like image 200
Mr. Alien Avatar answered Oct 21 '22 16:10

Mr. Alien