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

              
                <section id="profile">
    <h1 class="name">イイダリョウ</h1>
    <p class="detail">Webデザイナー。神奈川県在住。 丹沢山地と相模湾の自然に囲まれて暮らしています。</p>
    <p class="link">さらに詳しい情報は<a href="#" target="">コチラ</a></p>
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/305282/profile/profile-512.jpg" alt="顔写真">
</section>

              
            
!

CSS

              
                /*ページ全体*/
body {
    font-family:"ヒラギノ角ゴ ProN W3", "Hiragino Kaku Gothic ProN", "游ゴシック", YuGothic, "メイリオ", Meiryo, Helvetica, Arial, sans-serif;
     color: #777;
     font-size: 14px;
}

/*外枠背景*/
#profile {
    width: 300px;
    margin: 0 auto;
    padding: 0px 10px 10px;
    background: #eee;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/*タイトル*/
#profile h1 {
    padding: 10px;
    font-size: 20px;
    color: #fff;
    background: #888;
    border-bottom: 3px solid  #C30D23;
    text-align: center;
}

/*リンク*/
#profile .link {
    font-size: 12px;
    transition: all 0.3s;
}

/*リンク(頭)*/
#profile .link:before {
    content: "※";
}

/*リンク(マウスオーバー)*/
#profile .link a:hover {
    opacity: 0.7;
}

/*写真*/
#profile img {
      width: 100%;
      height: auto;
      margin:  10px 0 0 0;
}
              
            
!

JS

              
                // イベントリスナ(DOM読み込み)
window.addEventListener('load', function() {

    // 変数定義(DOM取得)
    var target = document.querySelector("#profile img");

    // 関数定義
    function hakken () {

        // 配列
        var serif = ["隠しボタンを見つけてくれてありがとう。私の名前は“Atama”です。",
                     "何かご用はありませんか?", 
                     "私を閉じますか?", 
                     "本当に閉じますか?",
                     "もう少しあなたとお話ししたいです。それでも閉じますか?",
                     "……わかりました。ごきげんよう。"];
        var len = serif.length; //(配列数)

        // 制御構造(反復)
        for (var i =0; i < len; i++) {
            window.alert(serif[i]); 
        }
    }

    // イベントリスナ(クリック)
    target.addEventListener("click", hakken, false);
    
});
              
            
!
999px

Console