Pen Settings

HTML

CSS

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

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

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.

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

              
                <div class="img shadow2 fadein">
  <img class="rd" src="http://chiasmrhythm.files.wordpress.com/2014/03/sao1-3c_768x432.png">
</div>

<div class="img shadow4 fadein">
<img class="rd" src="http://chiasmrhythm.files.wordpress.com/2014/03/sao1-3c_768x432.png">
</div>

<div class="img shadow5 shadow1 fadein">
<img src="http://chiasmrhythm.files.wordpress.com/2014/03/sao1-3c_768x432.png">
</div>
              
            
!

CSS

              
                /* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

/*
 * box-sizing (IE8+)
 * floatの崩れを防止
 * パディングとボーダーを幅と高さに含める
 */
* {
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -o-box-sizing: border-box;
    -ms-box-sizing: border-box;
}

/* ==========================================================================
   Img styles: basic defaults
   ========================================================================== */

/*
 * ブロック要素内にimgがある場合に、画像の下に隙間が空くのに対応
 */
img {
    vertical-align: bottom;
    -ms-interpolation-mode: bicubic; /* IE7で画像縮小時の劣化防止 */
}

/*
 * Responsive-style
 */
.img img {
    width: 100%;
}
.img {
    height: auto;
    margin: 16px auto;
}
.img {
    display: table; /*重要*/
}
/* -----------------------------------------------------------
画像のwidth:100%は親要素に依存
画像のmax-width:100%は画像に依存(表示領域が画像より狭い場合は、IEだとサイズはそのまま、Chromeは縮小表示)
画像をセンター配置するには、ブロック要素にして「margin」で調整する(imgは「インライン要素」)
ブロック要素にするのは「margin」の”auto”がブロック要素でないと効果が出ないから。
上記のようにすれば、imgを囲むdivは不要だが、divで囲む方が後々便利。
その場合は、imgに指定していた「margin:0 auto;display:block」は親要素のdivに
指定することになるが、widthを指定しないと横幅100%になる。この場合問題はないが、
「display:block」ではなく、「display:table」を指定するとimgの幅で可変するdivに
なるので、この後のキャプションを付けたい場合で使えるのでやっておくと良い。
上記は「.img」のみに行う。
----------------------------------------------------------- */

/* ==========================================================================
   Useful styles: opinionated defaults
   ========================================================================== */

/*
 * Radius-style (IE8は非対応 - .pie 付与で対応、tableは「border-collapse:collapse;」があるので角丸にならない)
 */
.rd {
    border-radius: 4px!important;
    zoom: 1; /*PIE用*/
    position: relative; /*PIE用*/
}
.rd-t {
    border-radius: 4px 4px 0 0!important;
    zoom: 1; /*PIE用*/
    position: relative; /*PIE用*/
}
.rd-b {
    border-radius: 0 0 4px 4px!important;
    zoom: 1; /*PIE用*/
    position: relative; /*PIE用*/
}

/*
 * Shadow-style
 */
.shadow1 {
    box-shadow: 0 10px 6px -6px #777777;
}
.shadow2 {
    box-shadow: 0 1px 4px rgba(0,0,0,.3),0 0 40px rgba(0,0,0,.1) inset;
}
.shadow3 { /*PIEでもIE8不可*/
    box-shadow: rgba(0,0,0,.15) -1px 2px 0, rgba(255,255,255,1) -1px 2px 0 inset;
}
.shadow4 { /*PIEでもIE8不可*/
    position: relative;
}
.shadow4:after {
    position: absolute;
    display: block;
    content: "";
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: rgba(255,255,255,.5) 0 0 0 20px inset;
}
.shadow5 { /*PIEでもIE8不可*/
    position: relative;
    border: #D0D0D0 1px solid;
}
.shadow5:after {
    position: absolute;
    display: block;
    content: "";
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: rgb(255,255,255) 0 0 0 16px inset;
}

/*
 * Img - fadein / fadeout
 */
.fadein {
    -webkit-animation-name: fadein;
    -webkit-animation-duration: 1s;
    -webkit-animation-timing-function: linear;
    -webkit-animation-iteration-count: 1;
}
@-webkit-keyframes fadein {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}
.fadeout {
    -webkit-animation-name: fadeout;
    -webkit-animation-duration: 1s;
    -webkit-animation-timing-function: linear;
    -webkit-animation-iteration-count: 1;
}
@-webkit-keyframes fadeout {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}
              
            
!

JS

              
                
              
            
!
999px

Console