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. 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


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 id="wrapper-iphone">
  <ul id="tabMenu" class="tab">
    <li><a href="#news">뉴스</a></li>
    <li><a href="#webtoon">웹툰</a></li>
  <div id="tabTarget">
      <section id="news">
          <p>오늘의 뉴스</p>
      <section id="webtoon" class="off">
          <p>모두에게 완자가라는 웹툰 참 재미있는 거 같다.</p>


                #wrapper-iphone{width:320px;overflow:hidden;border:3px solid #666;border-radius:3px;}
#wrapper-iphone .tab {width:100%;display:table;margin:0;padding:0}
#wrapper-iphone .tab li {display:table-cell;border-left:1px solid #ebebeb;text-align:center;vertical-align:middle}
#wrapper-iphone .tab li:first-child {border-left:0}
#wrapper-iphone .tab li a {display:block;background:#666;color:#fff;text-decoration:none}
.off {display:none}
/* 실제 제작시에 display : none 을 사용하는 건 접근성을 매우 저해시키는 행위입니다 */


                var tab = function(sMenuSelector, sTargetSelector) {
  this._nIndex = 0;

tab.prototype = {
  display : function(nIndex) {
    this._nIndex = nIndex;
    this._aTargets[this._nIndex].className = "";
  _reset : function() {
    for(var i = 0; i < this._aTargets.length; i++) {
      this._aTargets[i].className = "off";
  _setMenu : function(sMenuSelector) {
    var oSelf = this;
    this._aMenu = document.querySelectorAll(sMenuSelector);
    for(var i = 0; i < this._aMenu.length; i++) {
      this._aMenu[i]._nIndex = i;
      this._aMenu[i].onclick = function() {
  _setTargets : function(sTargetSelector) {
    this._aTargets = document.querySelectorAll(sTargetSelector);

new tab("#tabMenu a", "#tabTarget section");