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

              
                <script src="//code.jquery.com/jquery-1.11.0.min.js"></script>


  <div class="row">
    <div class="col">
      <p>トグルされない</p>
      <button class="next">「次」の兄弟要素をトグル</button>
      <p>トグルされる</p>
    </div>
    <div class="col">
      <p>トグルされる</p>
      <button class="prev">「前」の兄弟要素をトグル</button>
      <p>トグルされない</p>
    </div>
  </div>
  <hr/>
  <div class="row">
    <div class="col">
      <p>トグルされない</p>
      <p>トグルされない</p>
      <button class="nextAll">「次以降」の兄弟要素をトグル</button>
      <p>トグルされる</p>
      <p>トグルされる</p>
    </div>
    <div class="col">
      <p>トグルされる</p>
      <p>トグルされる</p>
      <button class="prevAll">「前以前」の兄弟要素をトグル</button>
      <p>トグルされない</p>
      <p>トグルされない</p>
    </div>
</div>

              
            
!

CSS

              
                @import "compass/css3";

@import "compass/utilities/general/clearfix";
body {
  font-size: 12px;
}
.row {
  @include clearfix;
  width: 600px;
  margin: 20px auto;
  text-align: center;
  
  .col {
    float: left;
    width: 50%;
  }
 
  button {
    min-width: 120px;
    height: 30px;
    margin: 0;
  }
}

              
            
!

JS

              
                $(function () {
  
  //「次」の兄弟要素をトグル
  $(".next").click(function(){
    $(this).next().toggle();
  });

  //「前」の兄弟要素をトグル
  $(".prev").click(function(){
    $(this).prev().toggle();
  });

  //「次以降」の兄弟要素をトグル
  $(".nextAll").click(function(){
    $(this).nextAll().toggle();
  });
  
  //「前以前」の兄弟要素をトグル
  $(".prevAll").click(function(){
    $(this).prevAll().toggle();
  });

});
              
            
!
999px

Console