Hi guys i have some problems with
User Story #12: Each element with the class of nav-link
should contain text that corresponds to the header
text within each section
(e.g. if you have a “Hello world” section/header, your navbar should have an element which contains the text “Hello world”).
and
User Story #13: When I click on a navbar element, the page should navigate to the corresponding section of the main-doc
element (e.g. If I click on a nav-link
element that contains the text “Hello world”, the page navigates to a section
element that has that id and contains the corresponding header
.
MY CODE IS:
<section class="main-section" id="python">
<header id="python">Python</header>
</section>
<section class="main-section" id="introduction">
<header id="introduction" > introduction</header>
</section>
<section class="main-section" id="Programming">
<header id="Programming" >Programming</header>
</section>
<section class="main-section" id="Match_Statements">
<header id="Match_Statements">Match Statements</header>
</section>
<section class="main-section" id="Defining_Functions">
<header id="Defining_Functions">Defining Functions</header>
</section>
and the code of the navbar is:
<nav id="navbar">
<header>Python</header>
<ul>
<li><a href="#python" class="nav-link">Python</a></li>
<li><a href="#introduction" class="nav-link">introduction</a></li>
<li><a href="#Programming" class="nav-link">Programming</a></li>
<li><a href="#Match_Statements" class="nav-link">Match Statements</a></li>
<li><a href="#Defining_Functions" class="nav-link">Defining Functions</a></li>
</ul>
</nav>
i’m stuck with this problem