HTML exercise: Page layout: header, main and footer — Find the bug.
The header should hold only the name and the menu and end before the main content starts.
The exercise
Find the bug.
1<body>
2 <header>
3 <a href="/">Max Muster</a>
4 <nav>
5 <a href="lessons.html">Lessons</a>
6 </nav>
7 </head>
8 <main>
9 <h1>Guitar lessons</h1>
10 </main>
11</body>
Solution
The bug is in line 7.
- </head>
+ </header>
</head> is the end tag of the page head, not of <header>, so the browser ignores it here. The <header> stays open and swallows the whole <main> part as well.