homepage Welcome to WebmasterWorld Guest from 54.166.62.226
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Can I Use Two Header Tags in a Row
gouri

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4690463 posted 9:35 pm on Jul 24, 2014 (gmt 0)

In the following thread [webmasterworld.com...] (msg 4644863) I have something similar to the following:

- <header>
-- <p>Text here (Site title)</p>
-- <nav><ul><li>Link 1</li><li>Link 2</li><li>Link 3</li><li>Link 4</li></ul></nav>
-- <h1>Text here</h1>
-- <p>Few words to describe what body text is about</p>
- </header>

Would I be able to do the following instead:

- <header>
-- <p>Text here (Site title)</p>
-- <nav><ul><li>Link 1</li><li>Link 2</li><li>Link 3</li><li>Link 4</li></ul></nav>
- </header>
- <header>
-- <h1>Text here</h1>
-- <p>Few words to describe what body text is about</p>
- </header>
- <p>Couple of sentences here</p>
- <p>Couple of sentences here</p>

The content within the first <header> would be sitewide and the content within the second <header> would be page-specific.

The <p>Couple of sentences here</p> is the body text and would be unique to each page.

I appreciate your help.

 

piatkow

WebmasterWorld Senior Member piatkow us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 4690463 posted 8:56 am on Jul 25, 2014 (gmt 0)

From W3schools:

Definition and Usage

The <header> tag specifies a header for a document or section.

The <header> element should be used as a container for introductory content or set of navigational links.

You can have several <header> elements in one document.

Note: A <header> tag cannot be placed within a <footer>, <address> or another <header> element.

lucy24

WebmasterWorld Senior Member lucy24 us a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



 
Msg#: 4690463 posted 6:42 pm on Jul 25, 2014 (gmt 0)

the content within the second <header> would be page-specific.

But "page-specific" can have a wide range of meanings. At one end is "stuff containing this page's <h1>" which may not count as a header at all. At the other end is "navigation that distinguishes between the present page and other pages" which may not really count as "page-specific".

If the issue is that the two sections are produced by two different include files, I know the feeling :) I like to keep each include symmetrical: if it contains the opening to some element, it should also contain its closing. (This is probably a good habit in principle, but it isn't the only habit.)

gouri

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4690463 posted 2:58 pm on Jul 27, 2014 (gmt 0)

piatkow,

From reading what you posted, I think that it is okay to include the two <header> elements in the way that I have in my OP.

Do you think that it would be okay to do this?

lucy24,

Those are some good points about what page-specific can mean. On the About Us page, the <h1> will probably be About Us and on the Contact page, the <h1> will probably be Contact Us.

Does this help to decide whether it would be okay to code with the two <header> elements in the way that I have in my OP?

Regarding includes, I am not sure if the two sections are produced by two different include files, but it's a good point.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved