Log in   Register a New Account

Accessify Forum - Discuss Website Accessibility

New to the forum?

Only an email address is required.

Register Here

Already registered? Log In

Currently Online

No registered users are online.

H1 to H6 header structure question

  • Reply to topic
  • Post new topic
Reply with quote This might be a stupid question (was there not a beignners subforum here before?).

On a webpage, can you have heading without any paragraphs associated with it? As in, you have a sentence marked up as a H3 for instance but it hasn't any other elemetns like <p> that follows it?

Or should it then be a p and not a heading...?

I saw it in a footer of a webpage, it was like a tagline, marked up as H2, but it was the only thing there
Reply with quote
W3C wrote:
A heading element briefly describes the topic of the section it introduces.

Headings should be used to announce a new section, or subsection. There's no semantic reason why it has to have <p> or anything else after it, but it should serve the purpose of giving the page a hierarchical structure. Sometimes people incorrectly label text as a heading (often in a dubious attempt to improve search rankings) - maybe that's what has happened here? If it literally has no further content after it, it certainly sounds like a misuse of the tag.

Could you link to the site in question?

PS: yep there's still a beginners section - have moved this to there Smile

James Coltham - Local gov web manager by day, web and accessibility blogger at lunchtime, freelancer by night. Tweets at @prettysimple.
Reply with quote As James says, a heading should be used for a new section or subsection. If there's no content at all after the heading, it does sound like a misuse of the tag but it doesn't necessarily have to be a <p> tag. Any other tag, an image, list, blockquote, or whatever, could be used after a heading.

Logic would seem to dictate though that a heading's a heading for something, otherwise if there was no content following it, it wouldn't actually be a heading.

If it's not a heading, but "just" a sentence, then it most likely should be marked up as a paragraph, but that's not to say that visually it has to look like the standard paragraph text - you can style it to look however you want via your CSS. You could style it to look like your H3 tags (or any other 'h' tag), but if a screenreader user gets a heading, they're going to expect that there's something following that the header relates to, otherwise I'd suspect they'd be quite confused as to where the content they're expecting's gone to.

Fallen_Angel
ecanus.net
Reply with quote Good advice from both James and Fallen. As both have explained, it basically comes down to the simple test: what's it the heading for? If that's not immediately obvious, it very likely shouldn't be a heading! Smile
Reply with quote I'm also just learning HTML myself and the discussion here is really helping a lot. Thanks guys!
Reply with quote Use the H1 tag only once. Use of the other header tags can be multiple, BUT, keep them in order so H3 follows H2, and H4 follows H3, etc.

This helps the reader get a good idea of what is to follow and can navigate your page efficiently.
Reply with quote Not entirely true..

There exist no reasons why more than one h1 would effect your site negatively, and its also semantically correct to use h1s for navigation headers and such things.

In html5 you only use h1, and section elements to tell about nesting levels.
Reply with quote I think the title should be H1.
in the text should also have a more H1, H2, H3
Reply with quote Regard with the use of h1, h2, etc in our blog with the search ranking, I have no idea if the use if h1 can bring the negative effect while using varian heading can increase the search rank. But yes, I do use varian heading in my blog. Why? Have no correct answer since I only follow this from other person.
But regards on our question, yes I think there should be content after the heading. This will help readers to like more your blog.
Reply with quote
MasterUki wrote:
Not entirely true..

There exist no reasons why more than one h1 would effect your site negatively, and its also semantically correct to use h1s for navigation headers and such things.

In html5 you only use h1, and section elements to tell about nesting levels.

Semantically I don't see how that works. H1 is the top level element for the page, with all others being sub-headings, sub-sub-headings etc.
For navigation headers etc. you would use h2 and CSS to style them visually
Reply with quote
David Foster wrote:
MasterUki wrote:
Not entirely true..

There exist no reasons why more than one h1 would effect your site negatively, and its also semantically correct to use h1s for navigation headers and such things.

In html5 you only use h1, and section elements to tell about nesting levels.

Semantically I don't see how that works. H1 is the top level element for the page, with all others being sub-headings, sub-sub-headings etc.
For navigation headers etc. you would use h2 and CSS to style them visually


I think so. And don't forget the css, without it the headers are horrible!

Display posts from previous:   

All times are GMT

  • Reply to topic
  • Post new topic