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

              
                .container
  .row
    .col-xs-4.col-xs-offset-4.text-center
      h1 HTML iMac (scalable)
      p
        input.form-control#size(placeholder='Base font-size, e.g. "20px"')
    .col-xs-8.col-xs-offset-2#wrap
      .imac
        img.img-responsive(src="https://unsplash.it/1600/900?image=1067")
        .icon
          i.fa.fa-apple
              
            
!

CSS

              
                @mac-gradient-start: #cccccc;
@mac-gradient-end: #eeeeee;

@mac-foot-gradient-stop1: #808080;
@mac-foot-gradient-stop2: #fafafa;
@mac-foot-gradient-stop3: #777777;
@mac-foot-gradient-stop4: #aaaaaa;
@mac-foot-gradient-stop5: #999999;
@mac-foot-gradient-stop6: #dddddd;

body,
.wrap {
  font-size: 16px;
}
.imac {
  background: @mac-gradient-start;
  background: -moz-linear-gradient(left, @mac-gradient-start 0%, @mac-gradient-end 100%);
  background: -webkit-linear-gradient(left, @mac-gradient-start 0%, @mac-gradient-end 100%);
  background: linear-gradient(to right, @mac-gradient-start 0%, @mac-gradient-end 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='@{mac-gradient-start}', endColorstr='@{mac-gradient-end}',GradientType=1 );
  border-radius: 0.8em;
  color: #000;
  height: 20.7em;
  margin: 0 auto 4.3em auto;
  perspective: 3em;
  position: relative;
  text-align: center;
  width: 30em;
  
  &::after {
    background: @mac-foot-gradient-stop1;
    background: -moz-linear-gradient(top, @mac-foot-gradient-stop1 0%, @mac-foot-gradient-stop2 54%, @mac-foot-gradient-stop2 56%, @mac-foot-gradient-stop3 73%, @mac-foot-gradient-stop3 75%, @mac-foot-gradient-stop4 85%, @mac-foot-gradient-stop5 95%,  @mac-foot-gradient-stop5 99%,  @mac-foot-gradient-stop6 99%);
    background: -webkit-linear-gradient(top, @mac-foot-gradient-stop1 0%, @mac-foot-gradient-stop2 54%,@mac-foot-gradient-stop2 56%, @mac-foot-gradient-stop3 73%, @mac-foot-gradient-stop3 75%, @mac-foot-gradient-stop4 85%, @mac-foot-gradient-stop5 95%, @mac-foot-gradient-stop5 99%, @mac-foot-gradient-stop6 99%);
    background: linear-gradient(to bottom,  @mac-foot-gradient-stop1 0%, @mac-foot-gradient-stop2 54%, @mac-foot-gradient-stop2 56%, @mac-foot-gradient-stop3 73%, @mac-foot-gradient-stop3 75%, @mac-foot-gradient-stop4 85%, @mac-foot-gradient-stop5 95%, @mac-foot-gradient-stop5 99%, @mac-foot-gradient-stop6 99%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='@{mac-foot-gradient-stop1}', endColorstr='@{mac-foot-gradient-stop6}',GradientType=0 );
    border-bottom: 0.1em solid @mac-foot-gradient-stop6;
    border-bottom-right-radius: 1.5em 0.1em;
    border-bottom-left-radius: 1.5em 0.1em;
    bottom: -2.3em;
    content: "";
    height: 1em;
    left: 50%;
    margin-left: -3.7em;
    position: absolute;
    transform: rotateX(65deg);
    width: 7.5em;
  }
  img {
    border: 1.2em solid #000;
    border-radius: 0.8em 0.8em 0 0;
    height: 18em;
    margin-bottom: 0.4em;
    width: 30em;

  }
  .icon {
    font-size: 1.5em;
  }
}
              
            
!

JS

              
                var bodyFontSize = document.getElementById("size");
var wrapper = document.getElementById("wrap");

bodyFontSize.addEventListener('keyup', function() {
  wrapper.style.fontSize = bodyFontSize.value;
}, false);
              
            
!
999px

Console