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

              
                <a href="#" class="sample">今すぐ申し込む</a>

              
            
!

CSS

              
                body {
    padding: 3rem 0;
}

.sample {
    /*
    幅と高さにボーダーの幅が含まれるようになる
    ボタン関連は、これを指定しておかないと計算がややこしくなる
    */
    box-sizing: border-box;
    
    /* flexを指定して、インライン要素の本来の見た目から変更する */
    display: flex;

    /* 左右は text-align:center でもよいのだが */
    align-items: center;
    justify-content: center;

    /* カンプのボタンの大きさを、width, heightで指定する */
    width: 480px;
    height: 70px;

    /*
    楕円にするには、border-radiusをheightの半分にする
    デスクトップとスマホでボタンの大きさが変わる場合は、10emにする手もある
    */
    border-radius: 35px;

    /* 画面の左右中央に寄せる */
    margin-left: auto;
    margin-right: auto;

    /* 文字サイズは基本的にrem。html要素が16pxであれば20pxになる( 20 / 16 ) */
    font-size: 1.25rem;
    font-weight: bold;
    letter-spacing: 0.05em;

    color: #fff;
    background-color: #f88800;
    border-style: solid;
    border-width: 3px;
    border-color: #f88800;
}

a.sample {
    text-decoration: none;
}

/* 最近はカーソルを置いたとき&選択したときの効果をスマホには指定しないことが多い */
@media screen and (min-width:768px) {

    a.sample:hover,
    a.sample:focus {
        color: #f88800;
        background-color: #fff;

        /* 厳密にはallではなく個別にプロパティを指定した方が処理が早い */
        transition: all 0.5s;
    }

}

              
            
!

JS

              
                
              
            
!
999px

Console