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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <h1>Webデザイナーの仕事とは?</h1>
<nav>
  <a href="#c1">仕事の概要</a>
  <a href="#c2">Webデザイナーになるには</a>
  <a href="#c3">Webデザイナーの年収</a>
</nav>
<section id="c1" class="js-a">
  <h2>仕事の概要</h2>
  <p>Webデザイナーは主にWebサイトのデザインを担当する職種です。また、コーディングまでを行う場合も多いです。働く環境や、職場によっては、ディレクション、CMSなどのシステム構築まで行うこともあります。</p>
</section>
<section id="c2" class="js-a">
  <h2>Webデザイナーになるには?</h2>
  <p>Webデザイナーになるには・・・・・</p>
</section>
<section id="c3" class="js-a">
  <h2>Webデザイナーの年収</h2>
  <p>Webデザイナーの年収は・・・・・</p>
</section>

              
            
!

CSS

              
                body{
  margin:0;
  background:#eee;
  font-family:sans-serif;
  text-align:center;
}
h1{
  margin:2em 0 1em 0;
}
nav{
  max-width:600px;
  display:flex;
  justify-content:space-between;
  margin:0 auto;
}
nav a{
  background:#ccc;
  color:#000;
  padding:1em;
  margin:0 .5em;
  border-radius:5px;
  text-decoration:none;
  transition:.2s;
}
nav a:hover{
  background:gold;
}
section{
  max-width:600px;
  margin:2em auto;
  padding:2em;
  background:#fff;
  border-radius:.5em;
}
p{
  padding:2em 0;
  line-height:2em;
  text-align:left;
  display:none;
}
.js-a{
  transition:.3s;
}
.js-a:hover{
  background:tomato;
}
              
            
!

JS

              
                $('.js-a').click(function(){
  $(this).find('p').slideToggle();
});
              
            
!
999px

Console