123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <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>
            
          
!
            
              // ---------- 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;
  }
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console