Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <body>
    <div class="wrapper">
        <header id="header">  
            <div class="logo">
                <img src="https://res.cloudinary.com/petrepan/image/upload/v1572818197/logo_jgjmxb.svg" id="header-img" alt="logo">
                <h1>Mercedes-Benz</h1>
            </div>
            <nav id="nav-bar">
                <ul class="nav">
                    <li><a class="nav-link" href="#features">Features</a></li>
                    <li><a class="nav-link" href="#video">Trailer</a></li>
                    <li><a class="nav-link" href="#contact">Contact</a></li>
                </ul>
                <div class="burger">
                    <div class="burger1"></div>
                    <div class="burger2"></div>
                    <div class="burger3"></div>
                </div>
            </nav>    
        </header>   
        <section class="section-a">
            <div class="shadow">
                <div class="inner-text">
                    <h2>
                        Mercedes-Benz Vision EQS
                    </h2>
                    <p>
                        The Next Generational luxury-car with an astonishing design.
                    </p>
                </div>
            </div>    
        </section>
        <section id="features" class="features">
            <div class="contain">
                <div class="feature-one">
                    <h3>
                        A milestone in a new era for the automobile. 
                    </h3>
                    <p>
                        The VISION EQS show car is an outlook on the future of Mercedes-Benz. Because two things are timeless: the need for mobility and the need for luxury. Plus an inner uncertainty about what will come next. 
                    </p>
                </div>
                <div class="feature-two">
                    <h3>
                       Design: Sustainable. Intelligent. Luxurious.
                    </h3>
                    <p>
                       With its innovative, stretched “one bow” design, the VISION EQS takes the Progressive Luxury design philosophy of the EQ models by Mercedes-Benz into a new dimension. The “seamless” look of this dramatic and powerful sculpture is what gives the VISION EQS its majestic presence.
                    </p>
                </div>
            </div>
        </section>
        <section id="trailer">
            <iframe id="video" width="70%" height="400" src="https://www.youtube.com/embed/njW9E-fCzcY" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>      
        </section>
        <footer id="contact">
            <form id="form" action="https://www.freecodecamp.com/email-submit">
                <fieldset>
                    <legend>
                    <label for="">Contact Us</label> </legend>
                    <div>
                    <input type="text" placeholder="Enter Your Name" required>
                    <input type="email" id="email" name="email" placeholder="Enter Your Email here" required>
                    <input id="submit" type="submit">
                </fieldset>
            </form> 
        </footer>
    </div>
    </body>
</html>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Poppins&display=swap');

*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body{
    font-family: 'Poppins', sans-serif;
    color: #f3f0f0;
    background-color: #f3f0f0;
}

.wrapper{
    width: 100%;
}

#header{
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: flex-end;
    background-color: #000;
    position: fixed;
    top: 0;
    width: 100%;
}

.logo{
    margin: 10px 0 0 10px;  
    cursor: pointer; 
}

.logo img{
    width: 35px;
}

.logo h1{
   font-size: 24px;
   
}

#nav-bar{
    display: flex; 
    justify-content: flex-end;
    padding-bottom: 5px;
}

#nav-bar ul{   
    display: flex;
    list-style: none;
}

#nav-bar li a{
   padding-right: 25px;
   text-decoration: none;
   color: #f3f0f0;
   translate: transform 1s ease;
}

#nav-bar li:hover {
  transform: scaleY(2);
  
}

.section-a{
    background-image: url(https://res.cloudinary.com/petrepan/image/upload/v1572908120/mercedes2_iy7frg.jpg);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    height: 550px; 
    margin-top: 85px;
}

.shadow{
    height: 100%;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.inner-text{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    width: 90%;
}

.inner-text h2{
    font-size: 48px;
}

.inner-text p{
    font-size: 18px;
}

.features{
    color: #333;
    line-height: 1.7;
    margin: 20px 0;
}

.contain{
    width: 90%;
    margin: auto;
    padding: 20px;
}

.feature-one p{
    text-indent: 25px;
}

.feature-two{
    margin-top: 15px
}

.feature-two p{
    text-indent: 25px;
}

#video{
    width: 100%;
    display: flex;
    justify-content: center;
}

footer{
    background-color: #000;
    height: 250px;
    color: #f3f0f0;
    margin-top: 20px;
    text-align: center;
}

fieldset{
    display: flex;
    flex-direction: column;
    padding: 20px;
    width: 70%;
    margin: auto;
}

input[type="text"], input[type="email"]{
    width: 100%;
    padding: 5px;
    margin-top: 10px;
    background-color: transparent;
    border: .5px dashed #f3f0f0; 
}

input[type="text"]:focus, input[type="email"]:focus{
    border: none;
    background-color: #f3f0f0;
}

input[type="submit"]{
    cursor: pointer;
    padding: 6px 10px;
    margin-top: 10px;
    background-color: #f3f0f0;
    border:none;
}

input[type="submit"]:hover{
    background-color: transparent;
    color: #f3f0f0;
    border-bottom: 3px solid #f3f0f0;
}

legend{
    padding: 20px;
}

.burger1, .burger2, .burger3{
    width: 20px;
    height: 2px;
    background-color: #f3f0f0;
    margin: 5px;
}
.burger{
    cursor: pointer;
    display: none;
}

@media screen and (max-width:500px){
    .nav{
        height: 100vh;
        width: 100%;
        background-color:rgba(0, 0, 0, .9);
        position: absolute;
        right: 0;
        top:0;
        flex-direction: column;
        align-items: center;
        padding-top: 90px;
        transform: translateY(-100%);
        transition: transform 0.6s ease-in;
    }

    nav ul li{
        padding-bottom: 60px; 
    }

    #nav-bar li:hover {
        transform: scaleX(1.5);    
    }

    .burger{
        display: block;
        margin-right: 30px;
    }
    .nav-act{
        transform: translateY(0%);
    }

   .toggle .burger1{
        transform: rotate(-45deg) translate(-5px,5px);
    }

    .toggle .burger2{  
        opacity: 0;;
    }

    .toggle .burger3{
        transform: rotate(45deg) translate(-5px, -5px);
    }

}

@media screen and (max-width: 400px){
    .inner-text h2{
        font-size: 28px;
    }
    
    .inner-text p{
        font-size: 18px;
        margin-top: 5px;
    }
    
}
              
            
!

JS

              
                const navSlide = () => {
    const burger = document.querySelector('.burger');
    const nav = document.querySelector('.nav');


    burger.addEventListener('click', () => {
      nav.classList.toggle('nav-act');

      burger.classList.toggle('toggle')
    });
}

navSlide();
              
            
!
999px

Console