What would be the correct markup in this situation (page title and “rootline”)?

StackOverflow https://stackoverflow.com/questions/2381720

  •  24-09-2019
  •  | 
  •  

문제

So, in my current project, when you navigate to the "team" page, which has the path /home/about/company/team/ the header of the page looks like this:

/home/about/company/    <--- this is what i call the "rootline"
TEAM                    <-- this is the title of the current page

... content goes here ...

My current markup looks like this:

<h1>TEAM</h1>
<h2>/home/about/company/</h2>

<div id="content"> 
    <h3>Content Headline</h3>
    ... 
</div>

But it feels wrong to wrap the rootline in h2 tags. Actually, its not a headline, right? Whats your opinion on how to create good, semantic HTML in this case?

도움이 되었습니까?

해결책

It doesn't really matter that you wrap it in an H2. It's semantically okay. Here's what the W3C has to say about heading tags (H1 - H6)-

A heading element briefly describes the topic of the section it introduces. Heading information may be used by user agents, for example, to construct a table of contents for a document automatically.

Your H2 is a subdescription of the H1. ie: H1 describes the page subject, H2 describes the location. Works okay in my mind.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top