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

              
                <header>
  <nav class="global-nav">
    <ul>
      <li><a href="https://codepen.io/MelissaMMDP/pen/rVOGOQ" target="_blank">Grid</a></li>
      <li><a href="https://codepen.io/MelissaMMDP/pen/MwaEyB" target="_blank">Color</a></li>
    </ul>
  </nav>
</header>

<main class="main-intro">
  <h1>Sticky Footer <span class="animated bounceInDown">Magic</span></h1>
  <p>Please enjoy this simple CSS sticky footer <span class="icon-heart">&#10084;</span></p>
  <p class="muggle"><a href="https://codepen.io/MelissaMMDP/pen/LMbVQp" target="_blank">muggle sticky footer</a></p>
</main>

<footer>
  <p>
    <small>&copy; 2015 Melissa Canada</small>
  </p>
</footer>
              
            
!

CSS

              
                // ---------- VARIABLES (extra)

// GRID

//== box-sizing variable
@box-sizing: border-box;

//== column variables
@float: left;
@text-align: left;

//== width variables
@max-width: 1280;
@min-width: 320;

// FONT

// google web font imports
@import url(https://fonts.googleapis.com/css?family=Open+Sans:600,400,300);
@import url(https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300);

// font variables
@font-size: 16; // required by .grid mixin


// ---------- MIXINS (extra)

// GRID

//== clearfix mixin (required by .grid mixin)
.clearfix() {
  &:before, &:after {
    content: "";
    display: table;
    clear: both;
  }
}

//== box-sizing mixin
.bxz (@bxz: @box-sizing) {
  -webkit-box-sizing: @bxz;
  -moz-box-sizing: @bxz;
  box-sizing: @bxz;
  *, *:before, *:after {
    box-sizing: inherit;
  }
}

//== grid mixins
// full width grid - always included
.grid (@mixin; @maw: @max-width) {
  margin: 0 auto;
  width: 100%;
  .clearfix;
}

// full width grid mixin
.grid (@mixin; @miw: @min-width; @maw: @max-width) when (@mixin = full) {}

// max width grid mixin
.grid (@mixin; @maw: @max-width; @miw: @min-width) when (@mixin = maw) {
  max-width: unit((@maw / @font-size), em);
}

//== column mixin
.col(@span; @fl: @float; @ta: @text-align) {
  float: @fl;
  text-align: @ta;
  width: ((100% / 12 * @span)*1.0);
}


// ---------- pen STYLES

// GENERAL

html {
  .bxz;
  font-size: 100%;
  min-height: 100%; // !important - footer
  position: relative; // !important - footer
}

body {
  background: #ffffff;
  color: #000000;    
  font-family: 'Open Sans', sans-serif;  
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4; // !important unit-less to avoid poor inheritance behavior  
  margin-bottom: 5em; // !important - footer
  text-align: center;
}

main {
  .grid(full);
  padding: 2.5em 0;
}

h1 {
  color: #d92626;
  font-family: 'Open Sans Condensed', sans-serif;  
  font-size: 2.25em;
  font-weight: 400;
  line-height: 2.25;
  padding: 0.2777777777777778em;
  text-align: center;  
}

h1, p, ul {
  margin: 0;
}

ul {
  list-style: none;
  padding: 0;
}

a {
  &:link, &:visited {
    color: #d92626;
    text-decoration: none;
  }
  &:hover {
    color: #d92626;
  }
}

.muggle {
  margin-top: 10px;
}

.muggle a {
  &:link, &:visited {
    background-color: #d92626;
    color: #fff;
    padding: 10px;
    text-decoration: none;    
  }
  &:hover, &:active {
    background-color: #4db2Cb;
  }
}

// HEADER

header {
  .grid(full);
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 0.0625em solid lightgrey;    
  left: 0;
  margin-bottom: 1.25em;
  position: fixed;
  top: 0;
}

.global-nav {
  li {
    float: left;
    a {
      display: block;
      padding: 0.875em 0.9375em;
      &:link, &:visited {
        color: #d92626
      }
      &:hover {
        background: #d92626;
        color: #ffffff;
      }
      &:focus {
        background: #d92626;
        color: #ffffff;
      }
    }
  }
}

// MAIN

.icon-heart {
  color: #d92626;
}

.main-intro {
  .grid(maw);
  p {
    .col(12; @ta: center);
    padding: 0 1.25em 1.25em 1.25em;
  }
}

// FOOTER

footer {
  .grid(full);
  background: #ffffff;
  border-top: 0.0625em solid lightgrey;
  bottom: 0; // !important helps maintain set height 
  color: #000000;   
  height: 5em; // !important - must be < = body margin-bottom
  position: absolute; // !important clears
  p {
    .col(12; @ta: center);
    padding: 1.25em;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console