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

              
                    <!--This is the frame for our game. It holds and centers all our other elements-->
    <div id="gameholder">
        <!--This holds the title image-->
        <div id="title"></div>
        <!--This holds our penguins and yeti-->
        <div class="penguin1"></div>
        <div class="penguin2"></div>
        <div class="penguin3"></div>
        <div class="penguin4"></div>
        <div class="penguin5"></div>
        <div class="penguin6"></div>
        <div class="penguin7"></div>
        <div class="penguin8"></div>
        <div class="yeti"></div>
    </div>
              
            
!

CSS

              
                
/*This style  gives the body element in our HTML a cool blue background color*/
body {
    background-color: #ccf5f5;
}

/*This styles the div in the HTML that contains and centers our penguin game*/
#gameholder {
    width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/*This styles the title div in or HTML*/
#title {
    width: 600px;
    height: 150px;
    /*This property embeds an image into the background of our div*/
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/penguin_title.png');
}

/*This pseudo class is applied when the mouse hovers over the 1st penguin div*/
.penguin1:hover {
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/mound_1_hover.png');
    /*This property changes our cursor to a pointer indicating an interactive element*/
    cursor: pointer;
}

/*This pseudo class is applied when our 1st penguin div is clicked by the mouse button*/
.penguin1:active {
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/penguin_1.png');
}

/*This is the style for our 1st penguin div*/
.penguin1 {
    width: 200px;
    height: 200px;
    float: left;
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/mound_1.png');
}

/*These are the styles for our 2nd penguin div.*/

.penguin2:hover {
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/mound_2_hover.png');
    cursor: pointer;
}

.penguin2:active {
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/penguin_2.png');
}

.penguin2 {
    width: 200px;
    height: 200px;
    float: left;
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/mound_2.png');
}

/*These are the styles for our 3rd penguin div.*/

.penguin3:hover {
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/mound_3_hover.png');
    cursor: pointer;
}

.penguin3:active {
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/penguin_3.png');
}

.penguin3 {
    width: 200px;
    height: 200px;
    float: left;
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/mound_3.png');
}

/*These are the styles for our 4th penguin div.*/

.penguin4:hover {
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/mound_4_hover.png');
    cursor: pointer;
}

.penguin4:active {
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/penguin_4.png');
}

.penguin4 {
    width: 200px;
    height: 200px;
    float: left;
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/mound_4.png');
}

/*These are the styles for our 5th penguin div.*/

.penguin5:hover {
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/mound_5_hover.png');
    cursor: pointer;
}

.penguin5:active {
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/penguin_5.png');
}

.penguin5 {
    width: 200px;
    height: 200px;
    float: left;
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/mound_5.png');
}

/*These are the styles for our 6th penguin div.*/

.penguin6:hover {
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/mound_6_hover.png');
    cursor: pointer;
}

.penguin6:active {
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/penguin_6.png');
}

.penguin6 {
    width: 200px;
    height: 200px;
    float: left;
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/mound_6.png');
}

/*These are the styles for our 7th penguin div.*/

.penguin7:hover {
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/mound_7_hover.png');
    cursor: pointer;
}

.penguin7:active {
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/penguin_7.png');
}

.penguin7 {
    width: 200px;
    height: 200px;
    float: left;
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/mound_7.png');
}

/*These are the styles for our 8th penguin div.*/

.penguin8:hover {
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/mound_8_hover.png');
    cursor: pointer;
}

.penguin8:active {
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/penguin_8.png');
}

.penguin8 {
    width: 200px;
    height: 200px;
    float: left;
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/mound_8.png');
}

/*These are the styles for our yeti div.*/

.yeti:hover {
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/mound_9_hover.png');
    cursor: pointer;
}

.yeti:active {
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/yeti.png');
}

.yeti {
    width: 200px;
    height: 200px;
    float: left;
    background-image:url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1263878/mound_9.png');
}



              
            
!

JS

              
                
              
            
!
999px

Console