header nesting

For topics about current BETA or future releases, including feature requests.
Post Reply
User avatar
roedygr
Rank V - Professional
Rank V - Professional
Posts: 370
Joined: Fri Feb 17, 2006 5:22 am
Location: Victoria BC Canada
Contact:

header nesting

Post by roedygr » Mon Apr 28, 2014 6:15 pm

Officially you are supposed to nest h1 h2 h3 h4....

However I often use them like this h1 h2 h4

The errors you can make include:

1. skipping a level, e.g. h4 inside h2

2. nesting h2 inside h2, clearly an error.

3. putting h1 inside h2, a serious error.

There should be a way to configure 4 levels of pickiness:

1. no skipping levels permitted at all
2. may skip level, but inner must be 1+ deeper
3. may nest at same depth, but cannot use major inside more minor, e.g. use h2 for everything
4. you don't care about levels (at least for now. You have bigger fish to fry)

My philosophy is to turn pickiness level down, clean up the worst, then gradually increase it.

For example, I was originally quite relaxed about matching <p></p> tags. Now I have them strictly balanced.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3242
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: header nesting

Post by Albert Wiersch » Thu May 22, 2014 4:04 pm

Hello,

CSE HTML Validator should detect skipping levels and generate a non-warning non-error message for this which you can change to a warning or error if you'd like... but I'm not sure what you mean by nesting h2 inside h2 or h1 inside h2. The headings can't contain other headings and having an h2 and then an h1, or a h1 and then an h2 (one or more) should be fine.

If there is an h1, then h2, then h2, then h1 again, then that shouldn't be a problem as the h2's are "in" the first h1 and the next h1 starts another section (it's not "in" the first h1 or "in" the previous h2). At least that is my understanding.

Are you able to create a sample document with comments that clearly show the issues that you'd like to detect?

Thanks.
Image
Albert Wiersch

Post Reply