- Code: Select all
<div class="blue-strap">
<nav>
<ul>
<li>Link 1</li>
<li>Link 2</li>
<li>Link 3</li>
</ul>
</nav>
<section>
<h1>Main Section</h1>
<section>
</div>
<div class="white-background">
<section>
<p>Text for Main Section</p>
<section>
</div>
So <h1> is displays in a blue coloured <div> along with the <nav>, however the content is display in a <div> with a white background.
The desired structure is one <section> tag:
1. Untitled NAV
2. Main Section
But because of the aesthetics it must be split across two <div>s. This obviously validates with a <section> titled Main Section and an untitled <section>.
1. Untitled NAV
2. Main Section
3. Untitled SECTION
Is there a solution for this sort of problem in HTML5 as I have two new websites that I am developing at the same time and both of them are often running into this issue.
I thought a possible solution would be to move the <h1> within the <section> in the <div> with the white background and then using JavaScript move the <h1> tag into the blue coloured <div>. But is a valid solution to make it render correctly without JavaScript but render incorrectly with JavaScript? Is this a desirable practice?
An ideal solution would be able to link or two or more tags together so that the validate as the same tag even if they are split apart.
Some advice would be greatly appreciated.