cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

              <div class="contain">
  <div id="ponyo">
    <h1>@include centerEl;</h1>
    <p>With this SCSS mixin you'll be able to horizontally AND vertically center blocks of text dynamically, with ease</p>

<div class="contain">
  <div id="billmurray">
    <p>To use it, just <code>@include centerEl</code></p>
    <p>You can set some properties through parameters too, like the <code>left</code> position, <code>width</code> and <code>text-align</code>.</p>
    <p><small>Defaults: <code>$left: 50%, $width: 50%, $align: center</code></small></p>

<div class="contain">
  <div id="jeffgolenski">
    <p>But you don't have to horizontally align if you don't want to. Just include the mixin like this...</p>
    <code>@include centerEl($left: 95%, $align: left);</code>

<div class="contain">
  <div id="poppop">
    <p>Or you can include the mixin like this...</p>
    <code>@include centerEl($left: 5%, $width: auto, $align: left);</code>

<div class="contain">
  <div id="cred">
    <p>Forked and adapted from a <a href="http://jsfiddle.net/jeffgolenski/hchhT/13/" target="_blank">Fiddle</a> by <a href="https://twitter.com/jeffgolenski" target="_blank">@jeffgolenski</a></p>
              $base: #94c6fd;

@function dynamicColor ($color) {
  @if ( lightness($color) < 50% ) {
    @return #eee;
  } @else {
    @return #111;

@mixin centerEl ( $left: 50%, $width: 50%, $align: center ) {
  position: absolute;
  top: 50%;
  left: $left;
  -ms-transform: translate($left * -1,-50%);
  -webkit-transform: translate($left * -1,-50%);
  transform: translate($left * -1,-50%);
  width: $width;
  > * {
    display: block;
    padding: 0 10px;
    text-align: $align;
    width: 100%;

:root {
  background: $base;
  padding: 3em;
  .contain {
    background: white;
    box-shadow: 0 2px 2px darken($base, 15%);
    color: #111;
    font-size: 1.3em;
    height: 300px; max-width: 1000px; width: 100%;
    margin: 0 auto;
    text-shadow: 0 1px 2px rgba(black, 0.4);
    position: relative;
    + .contain {
      margin-top: 3em;
    a {
      color: dynamicColor($base);

#ponyo, #billmurray {
  @include centerEl;

#jeffgolenski {
  @include centerEl($left: 95%, $align: left);

#poppop {
  @include centerEl($left: 5%, $width: auto, $align: left);

#cred {
  @include centerEl($width: 80%)
Loading ..................