Whats problem in my code?? Please Help Me !! Failed:Your #navbar should have exactly one header element within it.

<!DOCTYPE html>
<html lang="en">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="styles.css"/>
<nav id="navbar">
<a class="nav-link" href="#Doc_1">Doc_1</a>
<a class="nav-link" href="#Doc_2">Doc_2</a>
<a class="nav-link" href="#Doc_3">Doc_3</a>
<a class="nav-link" href="#Doc_4">Doc_4</a>
<a class="nav-link" href="#Doc_5">Doc_5</a>
<main id="main-doc">
  <section class="main-section" id="Doc_1">
    <code>Hello world</code>
    <code>How are you</code>
    <code>My name is Narendra</code>
    <code>I am from India</code>
    <code>Completed B.tech</code>
    <p>Tells about Doc 1</p>
    <p>contains In depth Information</p>
  <section class="main-section" id="Doc_2">
    <p>Tells about Doc 2</p>
    <p>contains In depth Information</p>
    <section class="main-section" id="Doc_3">
      <p>Tells about Doc 3</p>
    <p>contains In depth Information</p>
    <section class="main-section" id="Doc_4">
      <p>Tells about Doc 4</p>
    <p>contains In depth Information</p>
    <section class="main-section" id="Doc_5">
    <code>Front End</code>
    <code>Back End</code>
    <code>Full Stack</code>
    <p>Tells about Doc 5</p>
    <p>contains In depth Information</p></section>

You need closing tag of navbar for it.

Another thing to consider is every <li> element should be wrapped in <ul> if you want it unordered or <ol> if you want it ordered element and rather than using <code> I believe there is more suitable element such as


And you can use <code> element in the more suitable context, such as the code it self.

Your <main> should be wrapped inside body element.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.