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="section">

  <div class="tabBox">
    <div class="tabArea">
      <div id="tab01" class="one_tab select"><span class="tab_inner">Tab1</span></div>
      <div id="tab02" class="one_tab"><span class="tab_inner">Tab2</span></div>
      <div id="tab03" class="one_tab"><span class="tab_inner">Tab3</span></div>
    </div>
  </div><!-- /.tabBox -->

  <div class="contents">

    <div class="tab_main is_show">
      <div class="innerArea">Tab1 text</div>
    </div>

    <div class="tab_main">
      <div class="innerArea">Tab2 text</div>
    </div>

    <div class="tab_main">
      <div class="innerArea">Tab3 text</div>
    </div>

  </div><!--contents-->

  <!-- ▼Tab under▼ -->
  <div class="tabBox">
    <div class="tabArea bottom">
      <div class="one_tab select"><span class="tab_inner">Tab1</span></div>
      <div class="one_tab"><span class="tab_inner">Tab2</span></div>
      <div class="one_tab"><span class="tab_inner">Tab3</span></div>
    </div>
  </div><!-- /.tabBox -->

  <p class="_a"><a href="https://125naroom.com/web/2948" target="_blank" class="link">View the note</a></p>
</div>
              
            
!

CSS

              
                .tabBox .tabArea {
  width: 100%;
  height: 80px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
}
.tabBox .tabArea .one_tab {
  width: 32.5%;
  display: block;
  text-decoration: none;
  transition-duration: 0.3s;
  text-align: center;
  color: #fff;
  cursor: pointer;
}
.tabBox .tabArea .one_tab:hover {
  opacity: 0.7;
  text-decoration: none;
}
.tabBox .tabArea .one_tab .tab_inner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 60px;
  transition-duration: 0.3s;
}
.tabBox .tabArea .one_tab:nth-child(1) .tab_inner {
  background-color: #94ad73;
}
.tabBox .tabArea .one_tab:nth-child(2) .tab_inner {
  background-color: #e6de6b;
}
.tabBox .tabArea .one_tab:nth-child(3) .tab_inner {
  background-color: #e8a48b;
}
.tabBox .tabArea .one_tab.select .tab_inner {
  height: 80px;
}
.tabBox .tabArea.bottom {
  align-items: flex-start;
}
.contents .tab_main {
  display: none;
  padding: 50px 25px;
  text-align: center;
  min-height: 280px;
  border: 2px solid #94ad73;
  transition-duration: 0.3s;
}
.tab_main.is_show {
  display: block;
}
.tab_main:nth-child(1).is_show {
  border: 2px solid #94ad73;
}
.tab_main:nth-child(2).is_show {
  border: 2px solid #e6de6b;
}
.tab_main:nth-child(3).is_show {
  border: 2px solid #e8a48b;
}

/*====================================================================
以下は不要です。
====================================================================*/
body {
  font-family: YuGothic, "游ゴシック体", "Yu Gothic", "ヒラギノ角ゴ Pro", "Hiragino Kaku Gothic Pro", "メイリオ", Meiryo, "MS Pゴシック", "MS PGothic", sans-serif;
  font-size: 16px;
  letter-spacing: .025em;
  line-height: 1.8;
  margin: 0;
}
@media screen and (max-width: 1024px) {
  body {
    font-size: 14px;
  }
}
.section {
  max-width: 1024px;
  margin: 0 auto;
  padding: 20px 20px 500px;
}
.section p._a {
  font-size: 12px;
  font-weight: bold;
  margin: 30px 0 0;
}
.section p._a .link {
  display: inline-block;
  color: #607D8B;
  padding-left: 1.3em;
  text-indent: -1.3em;
}
.section p._a .link:before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-top: 2px solid #607D8B;
  border-right: 2px solid #607D8B;
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
  margin-right: 10px;
}
              
            
!

JS

              
                var TabList = function(elParent,contentsParent) {
  this.elParent = $(elParent);
  this.el = this.elParent.find('.one_tab');
  this.contentsParent = $(contentsParent);
  this.contents = this.contentsParent.find('.tab_main');
};
TabList.prototype.fn = function() {
  var that = this;
  this.el.on('click', function() {
    var index = $(this).index();
    that.elParent.each(function(){
      $('.one_tab',this).removeClass('select').eq(index).addClass('select');
    });
    that.contents.removeClass('is_show').eq(index).addClass('is_show');
  });
};
var syncTab = new TabList('.tabBox', '.contents');
syncTab.fn();
              
            
!
999px

Console