Product Landing Page - Build a Product Landing Page

Tell us what’s happening:

Please Help!
Failed 23. Your #nav-bar should always be at the top of the viewport.

Failed: 24. Your Product Landing Page should use at least one media query.

Failed: 25. Your Product Landing Page should use CSS Flexbox at least once.

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">
    <title>Product Landing Page</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <!-- Header section -->
    <header id="header">
        <img id="header-img" src="https://via.placeholder.com/150x50" alt="Logo">
        <nav id="nav-bar">
            <a href="#home" class="nav-link">Home</a>
            <a href="#about" class="nav-link">About</a>
            <a href="#contact" class="nav-link">Contact</a>
        </nav>
    </header>

    <!-- Main content -->
    <main>
        <!-- Sections -->
        <section id="home">
            <h1>Welcome to Our Product</h1>
            <p>Learn more about our product and how it can benefit you.</p>
        </section>

        <section id="about">
            <h2>About Us</h2>
            <p>Information about our company and mission.</p>
        </section>

        <section id="contact">
            <h2>Contact Us</h2>
            <p>Get in touch with us for more information.</p>
        </section>

        <!-- Product video -->
        <div>
            <h2>Product Video</h2>
            <iframe id="video" src="https://www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0" allowfullscreen></iframe>
        </div>

        <!-- Contact form -->
        <form id="form" action="https://www.freecodecamp.com/email-submit" method="POST">
            <label for="email">Email:</label>
            <input type="email" id="email" name="email" placeholder="Enter your email address" required>
            <input type="submit" id="submit" value="Submit">
        </form>
    </main>
</body>
</html>
/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:130.0) Gecko/20100101 Firefox/130.0

Challenge Information:

Product Landing Page - Build a Product Landing Page

Hi there,

You must write CSS code in the styles.css file to do what those tests asked.

Use position: sticky to make the nav-bar always be at the top.

Use @media query for Test 24, and display: flex for Test 25.

1 Like

passed! Thank you :slight_smile:

1 Like