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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <nav>
    <div class="container">
        <input id="responsive-menu" type="checkbox">
        <label for="responsive-menu">Menu <span id="menu-icon"></span></label>
        <div id="overlay"></div>
        <ul>
            <li><a href="http://art.yale.edu/">Yale University School of Art</a></li>
            <li><a href="http://www.suzannecollinsbooks.com/">Suzanne Collins</a></li>
            <li><a href="http://www.arrestling.com/index.htm">Gulla’s Arrestling</a></li>
            <li><a href="http://www.roverp6cars.com/">MGBD Parts &amp; Services</a></li>
            <li><a href="http://www.irishwrecksonline.net/">Irish Shipwrecks Online</a></li>
            <li><a href="http://www.arngren.net/">Arngren</a></li>
            <li><a href="https://www.lingscars.com/">Ling's Cars</a></li>
            <li><a href="http://www.007museum.com/">JAMES BOND 007 MUSEUM</a></li>
            <li><a href="http://www.dokimos.org/ajff/">ACCEPT JESUS, FOREVER FORGIVEN!</a></li>
            <li><a href="http://ronoslund.com/">Ron Oslund's Home Page</a></li>
        </ul>
        <ul id="social-media">
            <li>
                <a href="https://dribbble.com/erinesullivan">
                    <i class="fab fa-dribbble"></i>
                    <span class="screen-reader-text">Dribbble</span>
                </a>
            </li>
            <li>
                <a href="http://codepen.io/erinesullivan/">
                    <i class="fab fa-codepen"></i>
                    <span class="screen-reader-text">CodePen</span>
                </a>
            </li>
            <li>
                <a href="https://twitter.com/erin_e_sullivan">
                    <i class="fab fa-twitter"></i>
                    <span class="screen-reader-text">Twitter</span>
                </a>
            </li>
            <li>
                <a href="https://www.linkedin.com/in/erinesullivan1">
                    <i class="fab fa-linkedin"></i>
                    <span class="screen-reader-text">LinkedIn</span>
                </a>
            </li>
            <li>
                <a href="https://www.instagram.com/erin_e_sullivan/">
                    <i class="fab fa-instagram"></i>
                    <span class="screen-reader-text">Instagram</span>
                </a>
            </li>
        </ul>
    </div>
</nav>

<main>
    <div class="container">
        <h1>Responsive Menu</h1>
        <p>This responsive menu was made with just HTML and CSS.</p>
        <p>The menu list was inspired by <a href="https://blog.rankingbyseo.com/bad-websites/">Bad Websites Examples: Top 50 Worst Websites Designs That Will Make You Cringe!</a> by <a href="https://www.rankingbyseo.com/">Ranking by SEO</a>. I'm very happy to see that <a href="http://spacejam.com/">Space Jam</a> was not on the list. It holds a special place in my heart.</p>
    </div>
</main>
              
            
!

CSS

              
                @import url(https://use.fontawesome.com/releases/v5.0.6/css/all.css);
@import url(https://fonts.googleapis.com/css?family=Oswald:400|Raleway:400,700,400italic,700italic);

*,
*:before,
*:after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: #1d1f20;
    color: #e5e5e5;
    font: 16px/1.25 'Raleway', sans-serif;
}

h1 {
    font-family: 'Oswald', sans-serif;
    text-align: center;
}

a {
    color: #a2ed56;
}

a:hover {
    color: #83e4e2;
    text-decoration: none;
}

.container {
    margin: 0 auto;
    max-width: 80em;
}

main .container {
    padding: 1em;
}

p {
    margin-left: auto;
    margin-right: auto;
    max-width: 40em;
}

.screen-reader-text {
    clip: rect(1px 1px 1px 1px);
    clip: rect(1px, 1px, 1px, 1px);
    height: 1px;
    overflow: hidden;
    position: absolute !important;
    width: 1px;
}



/************************************************/
/****************** NAVIGATION ******************/
/************************************************/
nav {
    background: #e5e5e5;
    color: #1d1f20;
    left: 0;
    position: relative;
    top: 0;
    width: 100%;
    z-index: 9999;
}

/*** INPUT ***/
nav input {
    opacity: 0;
    position: absolute;
    z-index: -1;
}

/*** LABEL ***/
nav label {
    cursor: pointer;
    display: block;
    font: 2em/1 'Oswald', sans-serif;
    padding: 0.5em;
}

/* Hamburger Icon */
#menu-icon,
#menu-icon:before,
#menu-icon:after {
    background: #1d1f20;
    border-radius: 0.05em;
    height: 0.2em;
    transition: all 0.2s ease-in-out;
    width: 100%;
}

#menu-icon {
    display: inline-block;
    margin: 0.4em 0;
    max-width: 1em;
    position: relative;
}

nav label #menu-icon {
    float: right;
}

#menu-icon:before,
#menu-icon:after {
    content: '';
    left: 0;
    position: absolute;
}

#menu-icon:before {
    top: -0.4em;
}

#menu-icon:after {
    bottom: -0.4em;
}

/* Close Icon */
nav input[type=checkbox]:checked + label #menu-icon {
    background: transparent;
}

nav input[type=checkbox]:checked + label #menu-icon:before {
    top: 0;
    transform: rotate(-45deg);
}

nav input[type=checkbox]:checked + label #menu-icon:after {
    bottom: 0;
    transform: rotate(45deg);
}


/*** MENU ***/
/* Overlay */
nav input:checked ~ #overlay {
    background: #e5e5e5;
    bottom: 0;
    left: 0;
    height: 100vh;
    position: fixed;
    right: 0;
    top: 0;
    width: 100vw;
    z-index: -1;
}

/* List */
nav ul {
    font-size: 1.5em;
    list-style: none;
    margin: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    text-align: center;
}

nav input:checked ~ ul {
    margin: 1em;
    max-height: inherit;
    opacity: 1;
}

nav ul > li {
    margin: 0.5em 0;
}

nav ul a {
    color: #1d1f20!important;
    text-decoration: none;
}

nav ul a:hover {
    text-decoration: underline;
}

/* Social Media */
nav ul#social-media > li {
    display: inline-block;
    font-size: 1.5em;
    margin: 0.5em;
}
              
            
!

JS

              
                
              
            
!
999px

Console