Product Landing Page - Build a Product Landing Page

Tell us what’s happening:

I tried to add the nav-bar at the top. but the thing is I’m not getting it done

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="styles.css">
    <title>Product Landing Page</title>
</head>
<body>
    <header id="header">
        <nav id="nav-bar">
            <a class="nav-link" href="#features">Features</a>
            <a class="nav-link" href="#video">Video</a>
            <a class="nav-link" href="#form">Sign up</a>
        </nav>
        <img id="header-img" src="logo.png" alt="Logo">
    </header>
    <main>
        <section id="features">
            <h2>Features</h2>
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sit amet nulla auctor, vestibulum magna sed, convallis ex.</p>
        </section>
        <section>
            <iframe id="video"
             src="https://www.freecodecamp.org/news/content/images/2021/03/video-example.mp4"></iframe>
        </section>
        <section>
            <form id="form"
    action="https://www.freecodecamp.com/email-submit">
                <input id="email" type="email"  name="email" placeholder="Enter your email address" required>
                <input id="submit" type="submit" value="Sign up">
            </form>
        </section>
    </main>
</body>
</html>
/* file: styles.css */
 .header {
            position: fixed;
            top: 0;
            width: 100%;
            background-color: #f0f0f0;
            padding: 1em;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .header-img {
            width: 50px;
            height: 50px;
            margin-right: 1em;
        }

        .nav-link {
            margin-right: 1em;
            text-decoration: none;
            color: #337ab7;
        }

        .nav-link:hover {
            color: #23527c;
        }

        .video {
            width: 100%;
            height: 300px;
            margin: 2em 0;
        }

        .form {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 2em;
        }

        .email {
            padding: 1em;
            margin-bottom: 1em;
            border: 1px solid #ccc;
            border-radius: 5px;
        }

        .submit {
            padding: 1em 2em;
            border: none;
            border-radius: 5px;
            background-color: #337ab7;
            color: #fff;
            cursor: pointer;
        }

        .submit:hover {
            background-color: #23527c;
        }
        @media (max-width: 768px) {
            #header {
                flex-direction: column;
                align-items: center;
            }

            .nav-bar {
                position: fixed;
                top: 0;
                width: 100%;
                z-index: 10;
            }

            .nav-link {
                margin-bottom: 1em;
            }
        }

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0

Challenge Information:

Product Landing Page - Build a Product Landing Page

Hello, your header in the CSS doesn’t need . remove and the code passes. :grinning:

Tq I passed the level.
:innocent:

1 Like