codedamn

Nav-link point working, but doesn't get resolved

Asked by Anurag Gupta about 2 years ago

0

In html basics, there's a section to build a landing page.

I can't resolved this one point.

When I click a .nav-link button in the nav element, I am taken to the corresponding section of the landing page

Here is what I did. What am I doing wrong here?

<body>
    <header id="header">
        <img src="https://logos-world.net/wp-content/uploads/2020/12/Lays-Logo.png" alt="" id="header-img">

        <nav id="nav-bar">
            <a class="nav-link" href="#form-section"> Form </a>
            <a class="nav-link" href="#"> Contact </a>
            <a class="nav-link" href="#"> Cart </a>
        </nav>
    </header>
    <section>

        <video id="video" controls>
            <source src="https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4" type="video/mp4"> Your browser does not support the video tag.
        </video>
    </section>
    <section id="form-section">
        <form action="" method="post" id="form">
            <input type="email" name="email" placeholder="Enter Email" id="email">
            <input type="submit" id="submit">
    </form>
        
    </section>
    
</body>

3 Answers

    1

    Sorted.

    We can't have a nav-link with href value as '#'. As in just for this assignment.. not in general

    @anuraag

    Anurag Gupta

    @anuraag

    0

    remove # from first anchor tag

    @ajeet323327

    Ajeet Yadav

    @ajeet323327

    0

    Hey, that # is necessary. Though I'm not sure if it will work without the # too.

    @anuraag

    Anurag Gupta

    @anuraag

Your answer