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

              
                <p>첫 번째 탭메뉴</p>
    <ul class="tab-menu" id="tabMenu1">
        <li>탭 메뉴 1</li>
        <li>탭 메뉴 2</li>
        <li>탭 메뉴 3</li>
        <li>탭 메뉴 4</li>
        <li>탭 메뉴 5</li>
        <li>탭 메뉴 6</li>
    </ul>
    <p>두 번째 탭메뉴</p>
    <ul class="tab-menu" id="tabMenu2">
        <li>공지 사항</li>
        <li>뉴스레터</li>
        <li>이벤트</li>
        <li>주의사항</li>
    </ul>
              
            
!

CSS

              
                .tab-menu {
  list-style: none;
  height: 80px;
}

.tab-menu li {
  width: 99px;
  overflow: hidden;
  display: inline-block;
  float: left;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #000;
}

.tab-menu li:hover {
  background: #c0c0c0;
}

.tab-menu li.select {
  background: lightpink;
}
              
            
!

JS

              
                /**
 * ----------------------------------------------------
 * 클로저가 사용된 탭메뉴
 * ----------------------------------------------------
 */
$(document).ready(function() {

  tabMenu("#tabMenu1 li");

  tabMenu("#tabMenu2 li");
});

function tabMenu(selector) {

  // 클로저 함수에서 지역변수인 $selectMenuItem 을 사용하고 있음.
  var $selectMenuItem = null;

  /**
   * ----------------------------------------------------
   * 이벤트 리스너 부분이 콜백함수이자 클로저함수
   * ----------------------------------------------------
   */
  $(selector).click(function() {

    if ($selectMenuItem != null) {
      $selectMenuItem.removeClass("select");
    }

    $selectMenuItem = $(this);
    $selectMenuItem.addClass("select");

  })
}
              
            
!
999px

Console