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

              
                ol
 li.half-pixel-after Generate content & transform: scale(.5)
 li.half-pixel-img border-image stretch & svg
 li.half-pixel-background-svg background: url(svg)
 li.half-pixel-original half pixel support (works on Safari) 
 li.half-pixel-background background: linear-gradient (visible when dpr gte 2)

div(style="text-align:center")
  h2 圆角细线
  .avatar-box
    img(src="http://ww3.sinaimg.cn/large/6eba2496gw1f3vtj57hjij20pq0pqwf3.jpg", width="60")
              
            
!

CSS

              
                @import "bourbon";


@mixin hairline-radius($border-color: #d9d9d9, $radius: 0) {
  position: relative;
  &::after{
    content: '';
    @include position(absolute, -50%);
    border: solid 1px $border-color;
    transform: scale(.5);
    transform-origin: center center;
    pointer-events: none;
    border-radius: $radius*2;
  }
}

$border-color: #aaa;
body { color: #444; }
li {
  margin: 10px; padding: 5px 10px;
}
.half-pixel {
  // https://github.com/huanghuiquan/1px
  &-after {
    position: relative;
    &::after {
      content: '';
      @include position(absolute, null 0 0 0);
      border-bottom: solid 1px $border-color;
      transform: scaleY(.5);
      transform-origin: 0 100%;
    }
  }
  &-background {
    background: linear-gradient(transparent 50%, $border-color 50%) no-repeat left bottom;
    background-size: 100% 1px;
  }
  &-background-svg {
    background: url('data:image/svg+xml,\
      <svg xmlns="http://www.w3.org/2000/svg" width="1" height="1">\
      <rect width="1" height="0.5" fill="#{$border-color}"/>\
      </svg>') repeat-x bottom;
  }
  &-img {
    border-width: 0 0 1px;
    border-image: url('data:image/svg+xml,\
    <svg xmlns="http://www.w3.org/2000/svg" width="10" height="40">\
      <rect width="10" height="10" fill="#{$border-color}" />\
      <rect y="30" width="10" height="10" fill="#{$border-color}" />\
    </svg>') 20 0 stretch;
  }
  // https://github.com/maxzhang/maxzhang.github.com/issues/4#issuecomment-69145019
  &-original {
    border-bottom: solid 1px $border-color;
    border-width: 0.5px;
  }
}
// http://stackoverflow.com/questions/8640521/can-you-have-a-0-5px-border-on-a-retina-display/25910251#25910251


.avatar-box {
  padding: 2px; display: inline-block;
  @include hairline-radius(#b2b2b2, 5px);
}


              
            
!

JS

              
                
              
            
!
999px

Console