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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

              
                <!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="style.css" />
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link href="https://fonts.googleapis.com/css2?family=Libre+Franklin:wght@300&family=Urbanist:wght@600&display=swap"
        rel="stylesheet" />
    <title>Landing Page</title>
</head>

<body>
    <nav id="navbar">
        <ul id="navlist">
            <li class="list_items"><a href="#home">Home</a></li>
            <li class="list_items"><a href="#services">Services</a></li>
            <li class="list_items"><a href="#about">About</a></li>
            <li class="list_items"><a href="#contact">Contact</a></li>
        </ul>
    </nav>
    <div id="home">
        <h2>Welcome!</h2>
        <p>
            Lorem ipsum dolor sit, amet consectetur adipisicing elit. Illum, quod
            accusantium excepturi quaerat.
        </p>
        <p>Lorem ipsum dolor sit amet consectetur.</p>
        <a href="#services">
            Scroll Down
        </a>
    </div>
    <div id="services">
        <div class="services_item">
            <h2>Lorem Ipsum</h2>
            <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Repellendus explicabo ratione, porro, possimus
                eius nulla autem hic voluptatibus deserunt debitis laboriosam quia magni recusandae delectus a labore
                tempora illum eaque temporibus, dolorum id? Vero, minus inventore perferendis rerum quisquam dolorum
                accusantium nam magnam odit officia impedit, corrupti.</p>
        </div>
        <div class="services_item">
            <h2>Lorem Ipsum</h2>
            <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Repellendus explicabo ratione, porro, possimus
                eius nulla autem hic voluptatibus deserunt debitis laboriosam quia magni recusandae delectus a labore
                tempora illum eaque temporibus, dolorum id? Vero, minus inventore perferendis rerum quisquam dolorum
                accusantium nam magnam odit officia impedit, corrupti.</p>
        </div>
        <div class="services_item">
            <h2>Lorem Ipsum</h2>
            <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Repellendus explicabo ratione, porro, possimus
                eius nulla autem hic voluptatibus deserunt debitis laboriosam quia magni recusandae delectus a labore
                tempora illum eaque temporibus, dolorum id? Vero, minus inventore perferendis rerum quisquam dolorum
                accusantium nam magnam odit officia impedit, corrupti.</p>
        </div>
    </div>
    <div id="about">
        <h2>About us</h2>
        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Illo quam amet enim rem mollitia delectus fugiat
            aspernatur a laborum quod laboriosam non modi nesciunt, eligendi culpa, cupiditate quis velit fuga corporis
            expedita animi illum incidunt itaque voluptatibus. Vero officiis non, repellendus voluptatum dolorum
            assumenda nihil rem. Quasi quo fugit, voluptatum explicabo nemo nulla, aliquam tenetur dolor repellat
            provident laudantium quisquam commodi a. Quidem, ipsa voluptate? Blanditiis consequatur modi magnam aliquam
            temporibus ullam libero ab quibusdam, deleniti ratione quis ipsam sunt quo animi qui impedit doloribus.
            Fugit sint id nam expedita est officiis unde beatae, voluptate excepturi nihil repudiandae illo dolorem
            exercitationem. Numquam voluptates facere ut sit culpa! Reiciendis fugit corporis perspiciatis. Ea at a
            recusandae optio itaque nostrum debitis aspernatur asperiores id dignissimos possimus, beatae veritatis unde
            voluptate omnis laudantium reprehenderit fugiat minima accusantium non exercitationem! Voluptas ducimus
            iusto deleniti amet adipisci. Corrupti dolores, cupiditate in accusantium fugit architecto sequi blanditiis
            fuga nesciunt soluta natus officiis atque. Iste, enim, autem nemo totam sint possimus distinctio sed quos
            cum illo architecto blanditiis aperiam, voluptate similique sit nesciunt repellendus natus? Quam veniam unde
            quae sit cupiditate quo laudantium rem laborum fugit recusandae nesciunt incidunt eligendi sequi delectus,
            fugiat voluptates voluptate saepe dolorem.</p>
    </div>
    <div id="contact">
        <h2>Contact Us</h2>
        <p> (This is a dummy page so Please DON'T provide personal information)</p>
        <form action="#">
            <label for="name">Name</label>
            <input type="name" id="name" placeholder="Enter Your Name" required>
            <label for="email">Email</label>
            <input type="email" id="email" placeholder="Enter Your Email" required>
            <label for="age">Age (Optional)</label>
            <input type="number" id="age" placeholder="Enter your age">
            <label for="dropdown">Select your gender</label>
            <select name="dropdown" id="dropdown">
                <option value="Male">Male</option>
                <option value="Female">Female</option>
                <option value="other">Other</option>
            </select>
            <label for="comment">Help us Improve</label>
            <textarea placeholder="Add Additional comments" id="comment" rows="5" cols="30"></textarea>
            <button type="submit">Submit</button>
        </form>
    </div>

    <div id="footer">
        <p>Made by <a href="https://codepen.io/mrohanrajput" target="_blank">@Me</a></p>
    </div>
</body>

</html>
              
            
!

CSS

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

/* html  */
html {
    scroll-behavior: smooth;
}

/* scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background-color: var(--header-black);
}

::-webkit-scrollbar-thumb {
    background-color: gray;
    border-radius: 25px;
    height: 0px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #e76f51;
}

/* variables */
:root {
    --header-black: #212227;
    --main-background: #637074;
    --cool-grey: #8693AB;

}

/* NAVBAR STARTS */
#navbar {
    background-color: var(--header-black);
    position: fixed;
    width: 100%;
    box-shadow: rgba(0, 0, 0, 0.25) 0px 14px 28px, rgba(0, 0, 0, 0.22) 0px 10px 10px;
}

#navbar ul {
    display: flex;

    list-style: none;
    padding: 20px 0px 20px 0px;
    margin-left: 10px;
}

#navbar ul li a {


    text-decoration: none;
    margin: 50px 0px 50px 0px;
    padding: 20px 24px 20px 24px;
    color: whitesmoke;
    font-family: 'Urbanist', sans-serif;


}

#navbar ul li a:hover {
    background: rgb(0, 0, 15);
    background: linear-gradient(90deg, rgb(0, 0, 15) 0%, rgba(0, 0, 70, 1) 30%);
    color: rgba(255, 255, 255, 0.795);

}

/* NAVBAR ENDS */


/* HOME STARTS */
#home {
    background: rgb(0, 0, 15);
    background: linear-gradient(90deg, rgba(0, 0, 15, 1) 0%, rgba(0, 0, 50, 1) 90%);

    color: #e76f51;
    text-align: center;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

}

#home h2 {
    font-size: 50px;
    margin-left: 10px;
    margin-right: 10px;
    font-family: 'Urbanist', sans-serif;
}

#home p {
    font-size: 20px;
    margin-left: 10px;
    margin-right: 10px;
    font-family: 'Libre Franklin', sans-serif;
}

#home a {
    font-family: 'Urbanist', sans-serif;
    text-decoration: none;
    font-size: 30px;
    margin-top: 40px;
    padding-bottom: 0px;
    color: white;
    transition: font-size 0.4s;
}

#home a:hover {
    font-size: 40px;
}

/* HOME ENDS */



/** SERVICES STARTS **/
#services {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100vh;

    background: hsla(29, 92%, 70%, 1);

    background: linear-gradient(90deg, hsla(29, 92%, 70%, 1) 0%, hsla(0, 87%, 73%, 1) 100%);

    background: -moz-linear-gradient(90deg, hsla(29, 92%, 70%, 1) 0%, hsla(0, 87%, 73%, 1) 100%);

    background: -webkit-linear-gradient(90deg, hsla(29, 92%, 70%, 1) 0%, hsla(0, 87%, 73%, 1) 100%);

    filter: progid: DXImageTransform.Microsoft.gradient(startColorstr="#F9B16E", endColorstr="#F68080", GradientType=1);
}

.services_item {
    color: #141414;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    margin: 10px;
    height: 280px;

    box-shadow: rgba(0, 0, 0, 0.17) 0px -23px 25px 0px inset, rgba(0, 0, 0, 0.15) 0px -36px 30px 0px inset, rgba(0, 0, 0, 0.1) 0px -79px 40px 0px inset, rgba(0, 0, 0, 0.06) 0px 2px 1px, rgba(0, 0, 0, 0.09) 0px 4px 2px, rgba(0, 0, 0, 0.09) 0px 8px 4px, rgba(0, 0, 0, 0.09) 0px 16px 8px, rgba(0, 0, 0, 0.09) 0px 32px 16px;
    box-shadow: rgba(0, 0, 0, 0.56) 0px 22px 70px 4px;
    background: hsla(265, 53%, 29%, 1);

    background: linear-gradient(90deg, hsla(265, 53%, 29%, 1) 0%, hsla(24, 93%, 73%, 1) 100%);

    background: -moz-linear-gradient(90deg, hsla(265, 53%, 29%, 1) 0%, hsla(24, 93%, 73%, 1) 100%);

    background: -webkit-linear-gradient(90deg, hsla(265, 53%, 29%, 1) 0%, hsla(24, 93%, 73%, 1) 100%);

    filter: progid: DXImageTransform.Microsoft.gradient(startColorstr="#432371", endColorstr="#FAAE7B", GradientType=1);

    transition: box-shadow 0.2s;


}

.services_item:hover {
    /* height: 290px; */
    box-shadow: none;
    color: black;
}

.services_item h2 {
    font-size: 30px;
    font-family: 'Urbanist', sans-serif;
}

.services_item p {
    font-size: 17px;
    font-family: 'Libre Franklin', sans-serif;
}

/** SERVICES ENDS **/
/** ABOUT SECTION STARTS **/
#about {
    background: url(https://bit.ly/3tiVShK) no-repeat center center/cover;
    padding: 50px 150px 50px 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    align-items: center;
    height: 90vh;
    color: white;

}

#about h2 {
    font-family: 'Urbanist', sans-serif;
    font-size: 40px;
}

#about p {
    font-family: 'Libre Franklin', sans-serif;
    font-size: 18px;
}


/** ABOUT SECTION ENDS **/


/** CONTACT SECTION STARTS **/
#contact {
    padding-top: 200px;
    padding-bottom: 200px;
    display: flex;
    flex-direction: column;
    height: 600px;
    justify-content: center;
    align-items: center;
    background: hsla(40, 94%, 74%, 1);

    background: linear-gradient(90deg, hsla(40, 94%, 74%, 1) 0%, hsla(60, 89%, 72%, 1) 100%);

    background: -moz-linear-gradient(90deg, hsla(40, 94%, 74%, 1) 0%, hsla(60, 89%, 72%, 1) 100%);

    background: -webkit-linear-gradient(90deg, hsla(40, 94%, 74%, 1) 0%, hsla(60, 89%, 72%, 1) 100%);

    filter: progid: DXImageTransform.Microsoft.gradient(startColorstr="#FBD07C", endColorstr="#F7F779", GradientType=1);
}

#contact h2,
p {
    font-family: 'Urbanist', sans-serif;

}

#contact label {
    font-family: 'Urbanist', sans-serif;
    margin: 5px;
}

#contact form {
    display: flex;
    flex-direction: column;
    justify-content: center;

}

#contact input,
select,
textarea {
    box-shadow: rgba(0, 0, 0, 0.18) 0px 2px 4px;
    box-shadow: inset 6px 6px 6px #cbced1, inset -6px -6px 6px white;
    margin: 5px;
    border: none;
    border-radius: 10px;
    height: 30px;
    padding: 6px;
    outline: none;
    font-family: 'Libre Franklin', sans-serif;
}

#contact input:focus,
select:focus,
textarea:focus {
    box-shadow: none;
    padding: 15px;
}

#comment {
    padding: 3px;

}

#contact textarea {
    line-height: 20px;
    resize: none;
    overflow: auto;
    height: auto;
    display: block;

}

#contact button {
    font-size: 17px;
    margin: 3px;
    background: hsla(217, 100%, 50%, 1);

    background: linear-gradient(90deg, hsla(217, 100%, 50%, 1) 0%, hsla(186, 100%, 69%, 1) 100%);

    background: -moz-linear-gradient(90deg, hsla(217, 100%, 50%, 1) 0%, hsla(186, 100%, 69%, 1) 100%);

    background: -webkit-linear-gradient(90deg, hsla(217, 100%, 50%, 1) 0%, hsla(186, 100%, 69%, 1) 100%);

    filter: progid: DXImageTransform.Microsoft.gradient(startColorstr="#0061FF", endColorstr="#60EFFF", GradientType=1);

    color: black;
    font-family: 'Urbanist', sans-serif;
    height: 40px;
    border: none;
    border-radius: 22px;

    box-shadow: rgba(50, 50, 93, 0.25) 0px 30px 60px -12px inset, rgba(0, 0, 0, 0.3) 0px 18px 36px -18px inset;
    box-shadow: rgba(0, 0, 0, 0.56) 0px 22px 70px 4px;
    transition: box-shadow 0.05s, height 0.1s;
}

#contact button:active {
    box-shadow: none;
}

#contact button:hover {
    height: 41px;
}

/** CONTACT SECTION ENDS **/

/** footer **/
#footer {
    color: white;
    background-color: var(--header-black);
    margin: 0;
    position: relative;
    text-align: center;
    margin-top: 0;
    height: 30px;
    padding: 5px;
}

#footer a {
    text-decoration: none;
    color: yellow;
}

/** FOOTER ENDS **/
/** MEDIA QUERIES STARTS **/
@media (max-width : 1078px) {
    #navbar ul {

        margin-left: 0px;
    }

    #navbar ul li a {
        padding: 20px 12px 20px 12px;
    }

    #services {
        flex-direction: column;
        height: 1200px;
    }

    .services_item {
        margin: 20px;
        height: 350px;
    }

    #about {
        padding: 50px 10px 50px 10px;
        height: 100%;
    }

    #about p {
        font-size: 17px;
    }

    #contact p {
        text-align: center;
    }
}

@media (max-width: 300px) {
    #navbar ul {
        flex-direction: column;
        padding: 10px;
    }

    #navbar ul li {
        padding: 3px;
    }

    #navbar ul li a {
        padding: 5px;

    }

    #services_item {
        height: 500px;
    }
}

              
            
!

JS

              
                
              
            
!
999px

Console