Pen Settings



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


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


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.


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.


                <div class="tab">
  <!-- 初期状態で表示されるコンテンツに対応するラジオボタンにはchecked="checkedを設定する -->
  <input id="menu1" class="tab-input" name="menu" type="radio" checked="checked">
  <label for="menu1" class="tab-item">タブ1</label>
  <div class="tab-content">コンテンツ1</div>
  <input id="menu2" class="tab-input" name="menu" type="radio">
  <label for="menu2" class="tab-item">タブ2</label>
  <div class="tab-content">コンテンツ2</div>
  <input id="menu3" class="tab-input" name="menu" type="radio">
  <label for="menu3" class="tab-item">タブ3</label>
  <div class="tab-content">コンテンツ3</div>


                * {
  box-sizing: border-box;
/* ラジオボタンは非表示 */
input[type="radio"] {
  display: none;

.tab {
  width: 500px;
  max-width: 100%;
  margin: auto;
  display: flex;
  flex-flow: wrap;

.tab-item {
  display: block;
  width: calc(100% / 3);
  text-align: center;
  padding: 10px 0;
  cursor: pointer;
  order: -1;/* タブメニューは一番上に表示する */
  /* 下線以外をつける */
  border-top: 1px solid skyblue;
  border-left: 1px solid skyblue;
  border-right: 1px solid skyblue;

.tab-item:not(:first-of-type) {
  border-left: none;

/* アクティブなタブの背景色と文字色を変える */
.tab-input:checked + .tab-item {
  background: red;
  color: white;
/* コンテンツは原則非表示 */
.tab-content {
  width: 100%;
  height: 200px;
  display: none;
  justify-content: center;
  align-items: center;
  font-size: 40px;
  border: 1px solid skyblue;

/* ラジオボタンがチェックされているコンテンツだけは表示 */
.tab-input:checked + .tab-item + .tab-content {
  display: flex;