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

Details

Privacy

Go PRO Window blinds lowered to protect code. Code Editor with window blinds (raised) and a light blub turned on.

Keep it secret; keep it safe.

Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.

Upgrade to PRO

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.

Template

Make Template?

Templates are Pens that can be used to start other Pens quickly from the create menu. The new Pen will copy all the code and settings from the template and make a new Pen (that is not a fork). You can view all of your templates, or learn more in the documentation.

Template URL

Any Pen can act as a template (even if you don't flip the toggle above) with a special URL you can use yourself or share with others. Here's this Pen's template URL:

Screenshot

Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.

This Pen is using the default Screenshot, generated by CodePen. Upgrade to PRO to upload your own thumbnail that will be displayed on previews of this pen throughout the site and when sharing to social media.

Upgrade to PRO

HTML

              
                <div class="page">
<header>
        <img src="https://bennettfeely.com/me.jpg" width="200px" height="200px" />
        <h1>Bennett Feely</h1>
        <h3>I make websites so you don't have to.</h3>
    </header>
    
    <section>
        <article class="gallery site">
            <h2><a href="https://bennettfeely.com/flexplorer">Placeplace</a></h2>
            <h3><span class="filter">Gallery</span><time>June 2013</time></h3>
        </article>
        <article class="demo">
            <h2><a href="https://codepen.io/bennettfeely/pen/LKjmA">Toggles</a></h2>
            <h3><span class="filter">Demo</span><time>April 2013</time></h3>
        </article>
        <article class="site">
            <h2><a href="https://bennettfeely.com/csscreatures">CSS Creatures</a></h2>
            <h3><span class="filter">Gallery</span><time>March 2013</time></h3>
        </article>
        <article class="gallery site demo">
            <h2><a href="https://bennettfeely.com/filters-gallery/">Filters Gallery</a></h2>
            <h3><span class="filter">Gallery</span><time>February 2013</time></h3>
        </article>
        <article class="tool site demo">
            <h2><a href="https://bennettfeely.com/filters/">Filters Playground</a></h2>
            <h3><span class="filter">Tool</span><time>February 2013</time></h3>
        </article>
        <article class="demo">
            <h2><a href="https://codepen.io/bennettfeely/pen/esrtc">Type Snowflakes</a></h2>
            <h3><span class="filter">Demo</span><time>December 2012</time></h3>
        </article>
        <article class="demo">
            <h2><a href="https://codepen.io/bennettfeely/full/unqEB">Mega Shadow Text</a></h2>
            <h3><span class="filter">Demo</span><time>December 2012</time></h3>
        </article>
        <article class="site">
            <h2><a href="https://bennettfeely.com/flexplorer">The CSS Quiz</a></h2>
            <h3><span class="filter">Site</span><time>November 2012</time></h3>
        </article>
        <article class="site tool">
            <h2><a href="http://bennettfeely/define">Define</a></h2>
            <h3><span class="filter">Tool</span><time>October 2012</time></h3>
        </article>
        <article class="demo">
            <h2><a href="https://codepen.io/bennettfeely/pen/nrbiK">Blurry Passwords</a></h2>
            <h3><span class="filter">Demo</span><time>July 2012</time></h3>
        </article>
        <article class="demo">
            <h2><a href="https://codepen.io/bennettfeely/details/tKDAp">Sticky Notes</a></h2>
            <h3><span class="filter">Site</span><time>January 2012</time></h3>
        </article>
        <article class="site">
            <h2><a href="https://bennettfeely.com/labs/hoagieopen/">Hoagie Open</a></h2>
            <h3><span class="filter">Site</span><time>September 2011</time></h3>
        </article>
    </section>
    
    <footer><a href="https://twitter.com/bennettfeely"><span><i>t</i>@bennettfeely</span></a><a href="https://codepen.io/bennettfeely/"><span><i>c</i><span class="collapse">Codepen</span></span></a><a href="http://dribbble.com/bennettfeely"><span><i>d</i><span class="collapse">Dribbble</span></span></i></a><a href="https://plus.google.com/102233754358513450834/posts"><span><i>g</i><span class="collapse">Google+</span></span></a></footer>
</div>

              
            
!

CSS

              
                /* Fonts ====================================== */
    @font-face { font-family: 'Source Code Pro'; font-style: normal; font-weight: 200; src: local('Source Code Pro ExtraLight'), local('SourceCodePro-ExtraLight'), url(http://themes.googleusercontent.com/static/fonts/sourcecodepro/v3/leqv3v-yTsJNC7nFznSMqca9awK0IKUjIWABZIchFI8.woff) format('woff'); }
    @font-face { font-family: 'Source Code Pro'; font-style: normal; font-weight: 300; src: local('Source Code Pro Light'), local('SourceCodePro-Light'), url(http://themes.googleusercontent.com/static/fonts/sourcecodepro/v3/leqv3v-yTsJNC7nFznSMqdbE_oMaV8t2eFeISPpzbdE.woff) format('woff'); }
    @font-face { font-family: 'Source Sans Pro'; font-style: italic; font-weight: 400; src: local('Source Sans Pro Italic'), local('SourceSansPro-It'), url(http://themes.googleusercontent.com/static/fonts/sourcesanspro/v5/M2Jd71oPJhLKp0zdtTvoMzNrcjQuD0pTu1za2FULaMs.woff) format('woff'); }
    @font-face { font-family: "icon"; src: url('https://bennettfeely.com/fonts/icons.woff'); }

/* Reset ====================================== */
    * { box-sizing:border-box; margin:0; padding:0; vertical-align:baseline; }


/* Base ======================================= */
    html { font-size:150%; background:#; }
    
html {
  background:#333;
}

    body {
      font:300 100% "Source Code Pro", monospace;
      -webkit-overflow-scrolling:touch;
  background:whitesmoke;
    }

    h1, h2 {
        font-size:1.1rem;
        text-transform:uppercase;
    }

    a { text-decoration:none; color:black; }


    section { opacity:0; }
        .go section { opacity:1; }


/* Header ===================================== */
    header {
        padding:1rem;
        opacity:0;
    }
    .go header {
        animation:header-slide-up .6s backwards; 
        opacity:1;
    }
        @keyframes header-slide-up {
            from { transform:translate3d(0,200%,0); opacity:0; }
        }

    header:after { display:block; clear:both; content:""; } /* Clearfix */

    h1 {
        font-weight:300;
        color:#444;
        text-align:center;
        line-height:3rem;
        text-align:left;
    }
    
    img {
        float:left;
        width:3rem;
        height:3rem;
        border-radius:50%;
        margin-right:1rem;
    }

article { position:relative; transition:.4s; }

.filtering article {
    -webkit-filter:saturate(0);
    transform:translate3d(0,5px,0);
}

.filter-demo .demo,
.filter-gallery .gallery,
.filter-tool .tool,
.filter-site .site {
    -webkit-filter:none;
    transform:translate3d(0,0,0);
}

h2 {
    display:inline-block;
    font-weight:300;
    margin-left:-5px;
    box-shadow: -1px 1px, -2px 2px, -3px 3px, -4px 4px, -5px 5px, -6px 6px, -7px 7px, -8px 8px, -9px 9px, -10px 10px;   
    transition:.4s;
}

h2:hover {
    transform:translate3d(5px,-5px,0);
    transition:.15s;
}
h2:active {
    transform:translate(0);
    -webkit-filter:brightness(.7);
    transition::0;
}

article:hover + article { z-index:0; }

h2 a {
    display:block;
    padding:1rem 1rem 1rem 1.3125rem;
}

article {
    white-space:nowrap;
}
.go article {
    animation:slide-in .5s backwards;
}
    @keyframes slide-in { from { transform:translate3d(-100%,0,0); } }


footer {
    margin-top:1.5rem;
    background:linear-gradient(0deg,#222,#1a1a1a) #222 repeat-x;
    background-position:center top;
    background-size:100% 1rem;
    background:#333;
    color:#111;
    text-align:left;
    padding:.5rem 0;
}

footer a {
    display:block;
    transition:.3s;
    font:italic 1rem/1 "Source Sans Pro";
    padding:.75rem 1rem;
    transform-origin:center bottom;
    color:#222;
}
    
footer a:hover { background:#1a1a1a; }

footer a span { color:gray; }


footer i {
    display:inline-block;
    font:normal 1.5rem/1.5rem "icon";
    vertical-align:middle;
    margin:0 .5rem;
}


h3 {
    display:none;
    line-height:2rem;
    color:#555;
    font:italic 400 .8rem/1 "Source Sans Pro";   
    user-select:none;
}

.filter {
        display:inline-block;
        border:thin solid gainsboro;
        padding:.25rem .5rem;
        border-radius:.25rem;
        margin-right:.5rem;
        cursor:pointer;
        transition:.2s;
    }
        .filter:hover { box-shadow:inset 0 0 0 .125rem white, 0 0 0 .125rem white; color:black; }
        

    .active-filter:before {
        font-weight:bold;
        content:"×";
        padding-right:.25rem;
    }
    
time { display:none; }


::-webkit-scrollbar { width:.5rem; }
::-webkit-scrollbar-track { border-left:thin solid lightgray; background:whitesmoke; }
::-webkit-scrollbar-thumb { background:lightgray; transition:background .2s; }
::-webkit-scrollbar-thumb:hover { background:gray; }

@media (min-width:30em){    
    h1 {
        line-height:1.25rem;
        padding-top:.5rem;
    }
    
    h2 {
        font-size:1.25rem;
        font-weight:300;
    }
    
    h3 { display:inline-block; }
    
    footer {
        padding:0;
    }
    
    footer a {
        display:inline-block;
        width:50%;
        padding:1rem;
    }
    
}

@media (min-width:42em){    
    header, h2, footer a:first-child {
        padding-left:5%;        
    }
    
    img {
        width:5rem;
        height:5rem;
    }
    h1 { font-size:1.7rem; padding-top:.75rem; line-height:2.5rem; }
    
    h2 a {
        padding-left:1.5rem;
    }
    
    
    time {
        display:inline-block;
    }
    
    footer {
        display:flex;
        margin-left:-10px;
    }
    
    footer a {
        flex:auto;
        text-align:center;
        display:inline-block;
        width:auto;
        padding:1.25rem;
    } 
    
    footer a:hover {
        background:#222;
    }
    footer a:hover span { color:whitesmoke; }
    
    .collapse {
        outline:thin solid orange;
        display:none;
    }
}

@media (min-width:55em){
    header, h2, footer {
        padding-left:15%;        
    }
        
    h2 {
        font-size:1.5rem;
    }
    
    footer { display:block; }
    footer a:first-child { font-size:1.2rem; }
    
}

    @keyframes wave {
        50%{ transform:translate3d(-.5rem,0,0); } 
    }  
              
            
!

JS

              
                var $section = $("section");
var projects = $("article").length;
var pallete = Math.floor(Math.random() * 210);

$("article").each(function(i) {
    var hue = pallete + (i * 15);
    var css = 'animation-delay:' + ((i + 4) / 5) + 's;';
    $(this).attr("style", css);
});

$("section h2").each(function(i) {
    var hue = pallete + (i * 15);
    var css = 'background:hsl(' + hue + ',85%,70%); color:hsl(' + hue + ',45%,55%);';
    $(this).attr("style", css);
});

$(function() {
    $(window).load(function() {

        $("html").addClass("go");

        $(".filter").click(function() {
            var filter = $(this).text();

            $(".filter").removeClass("active-filter");

            $(".filter:contains(" + filter + ")").addClass("active-filter");

            if ($section.hasClass("filter-" + filter)) {
                console.log("match!");
                $(".filter").removeClass("active-filter");
                $section.removeClass();
            }
            else {
                $section.removeClass().addClass("filtering filter-" + filter);
            }
        });
    });
});
              
            
!
999px
What did the HTML say to the CSS? I like your style.

Console