Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>

<!-- Reworked for mobile first design 03/2021 -->

<body>
    <header id="header" class="header">
        <div class="logo">
            <div class="logo__name">3PE</div>
            <div><img id="header-img" class="logo__img" src="https://cdn-icons-png.flaticon.com/512/588/588436.png"
                    alt="3pe logo pencil icon">
            </div>
        </div>
        <nav id="nav-bar" class="menu">
            <div class="dropdown">
                <div class="dropdown__button">Our Products</div>
                <div class="dropdown__content">
                    <a class="nav-link" href="#sdp_marker">Super Deluxe pencils</a>
                    <a class="nav-link" href="#pp_marker">Premium Pencils</a>
                    <a class="nav-link" href="#sop_marker">Special Order Pencils</a>
                </div>
            </div>
            <a class="menu__button" href="https://pencils.com/pages/the-history-of-the-pencil" target="_blank">Pencils
                in History</a>
            <a class="menu__button" href="#email_marker">Contact Us</a>
        </nav>
    </header>
    <div id="topgap"></div>
    <main>
        <h1> Professional Pencil Pusher Enterprises</h1>
        <div class="prod-parent">
            <div id="sdp_marker"></div>
            <div class="prod-img"><img
                    src="https://images.pexels.com/photos/159752/pencil-office-design-creative-159752.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940"
                    alt="Super Deluxe Pencils image">
            </div>
            <div class="product">
                <h2>Super Deluxe Pencils</h2>
                <p>Our Super Deluxe line of pencils is some of the best in the world. You may have thought you've used a
                    good
                    pencil before, but until you try some of ours you won't know what you've been missing.</p>
                <p>Order some Super Deluxe pencils today and find out for yourself!</p>
            </div>
        </div>
        <div class="prod-parent">
            <div id="pp_marker"></div>
            <div class="prod-img">
                <img src="https://images.pexels.com/photos/56902/pexels-photo-56902.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940"
                    alt="Premium Pencils image">
            </div>
            <div class="product">
                <h2>Premium Pencils</h2>
                <p>Our Premium pencils are great for most any occasion. While not as wonderful as our Super Deluxe
                    pencils,
                    they are so much better than the average pencil that you'll have a hard time ever going back to
                    them.
                </p>
                <p class="text--bold">Give them a try today!</p>
            </div>
        </div>
        <div class="prod-parent">
            <div id="sop_marker"></div>
            <div class="prod-img"><img
                    src="https://images.pexels.com/photos/109255/pexels-photo-109255.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940"
                    alt="Special Order Pencils image">
            </div>
            <div class="product">
                <h2>Special Order Pencils</h2>
                <p>When a ready made pencil just won't do, it's time to reach for one of our Special Order pencils.
                    Designed
                    according to your custom specifications and hand made one pencil at a time from sustainably sourced
                    graphite and Amazon hardwoods and 100% organic clay. Built to the highest standards in the world,
                    you
                    won't
                    find a better pencil for that once in a lifetime occasion.</p>
                <p>Seeing is believing, so order your own Special Order pencils today!</p>
            </div>
        </div>
        <div class="vid-parent"><iframe id="video" width="560" height="315"
                src="https://www.youtube-nocookie.com/embed/FK7_F4kySZU" frameborder="0"
                allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
                allowfullscreen></iframe></div>
        <div id="email_marker"></div>
        <div class="contact">
            <h2>Contact Us</h2>
            <p class="contact__content">For more information regarding our amazing pencils, to place an order, check
                pricing or just to talk about how fantastic using well made pencils is, just enter your email address
                below and click Submit.
            </p>
            <form id="form" class="form" action="https://www.freecodecamp.com/email-submit">
                <label class="email__label">Email</label>
                <input name="email" type="email" id="email" placeholder="address@email.com" required><br>
                <input type="submit" id="submit">
            </form>

        </div>
        <div id="botgap"></div>
    </main>
    <footer>Author: Doug Wallace, freeCodeCamp/Github/CodePen: @broadsword-mo<br><a href="https://www.flaticon.com/free-icons/pencil" title="pencil icons">Pencil icon in logo created by Freepik - Flaticon</a></footer>
</body>
              
            
!

CSS

              
                /* Reworked for mobile first design 03/2021 */

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: calc(12.5px + 0.7vw);
    background-color: rgb(255, 187, 0);
    margin: 0;
}

.header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: #333;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.5);
    border: 3px solid rgb(220, 220, 220);
}

.logo,
.dropdown__button,
.menu__button,
footer {
    color: white;
}

.logo {
    position: relative;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 2.1rem;
}

.logo__name {
    position: absolute;
    left: 20px;
    top: 10px;
}

.logo__img {
    position: absolute;
    top: 17px;
    left: 75px;
    width: 2rem;
}

/* Nav-bar container */
.menu {
    display: flex;
    flex-direction: column;
}

/* Links in the nav-bar*/
.dropdown__button,
.nav-link,
.menu__button {
    display: block;
    text-align: center;
    font-size: 1rem;
    padding: 1em 1em;
    text-decoration: none;
    cursor: pointer;
}

/* Dropdown button */
.dropdown__button {
    margin-top: 0.3em;
    background-color: #333;
}

/* Add a gray background color to menu buttons and dropdown button on hover */
.menu__button:hover,
.dropdown:hover .dropdown__button {
    background-color: #666;
}

/* Dropdown container (hide by default) */
.dropdown__content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* Links inside the dropdown menu */
.nav-link {
    color: black;
    padding: 1em 1.2em;
    text-decoration: none;
}

/* Add a light gray background color to dropdown links on hover */
.nav-link:hover {
    background-color: #ccc;
}

/* Show the dropdown menu on hover */
.dropdown:hover .dropdown__content {
    display: block;
}

.menu__button:last-child {
    margin-bottom: 0.5rem;
}

main {
    width: 85%;
    margin: auto;
    text-align: left;
}

h1,
h2,
.form,
footer {
    text-align: center;
}

h1 {
    font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
    text-shadow: 0px 0px 15px aliceblue;

    /* Gaps it down from under fixed header */
    margin-top: 13rem;

    margin-bottom: 3rem;
}

h2 {
    color: rgb(51, 51, 51);
    outline-style: solid;
    outline-color: rgb(231, 150, 0);
    font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    text-transform: uppercase;
    line-height: 1.3;
    max-width: fit-content;
    padding: 0.5em 0.5em;
    margin: auto;
    margin-bottom: 1em;
}

.prod-parent {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 7em;
}

.prod-img img {
    width: 100%;
    max-width: 400px;
    margin-bottom: 1.5em;
}

.product {
    background-color: rgb(200, 255, 255);
    box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.5);
    padding: 1em;
    padding-bottom: 1.5em;
    border: double;
    border-color: rgb(150, 150, 150);
    border-radius: 5px;
}

.text--bold {
    text-align: center;
    padding-top: 1em;
    font-weight: bold;
}

.vid-parent {
    padding-top: 5em;
    text-align: center;
}

.vid-parent iframe {
    width: 100%;
    max-width: 560px;
}

.contact {
    padding-top: 15em;
}

.contact__content {
    padding-bottom: 1em;
}

#email {
    font-size: 1rem;
    min-height: 1.5rem;
    width: 15rem;
    padding: 0.5em;
}

#submit {
    font-size: 1.2rem;
    padding: .5em 2em;
    margin: 1em;
    border-radius: 5px;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

#botgap {
    height: 20rem;
}

footer {
    font-size: .9rem;
    line-height: 1.5em;
    padding: 2em;
    background-color: #333;
}

footer a{
  color: white;
}

@media screen and (min-width: 600px) {
    h2 {
        padding: 0.5rem 1rem;
    }

    .menu {
        flex-direction: row;
        justify-content: flex-end;
    }

    .dropdown__button,
    .menu__button,
    .menu__button:last-child {
        margin: 0;
        padding: 20px;
    }
    
    .menu__button:last-child {
        margin-right: 20px;
    }

    h1 {
        margin-top: 6rem;
    }
}

@media screen and (min-width: 900px) {
    .prod-parent {
        flex-direction: row;
        justify-content: center;
    }

    .prod-img img,
    .product {
        margin: 0;
    }

    .prod-img {
        flex: 1.5;
        margin-right: 1rem;
    }
    
    .prod-img img {
        max-width: 500px;
    }

    .product {
        flex: 2;
    }
}
              
            
!

JS

              
                
              
            
!
999px

Console