cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <ul>
  <li id="v" class="selected">縦並びにする</li>
  <li id="h">横並びにする</li>
</ul>

<h1>限定炙りほたて皿</h1>
<dl id="list" class="vertical">
  <dt>名前</dt>
  <dd>炙りほたて皿</dd>
  <dt>値段</dt>
  <dd>300円</dd>
  <dt>取扱店舗</dt>
  <dd>渋谷明治通り店</dd>
  <dd>新宿新南口店</dd>
  <dd>新宿東口店</dd>
</dl>
            
          
!
            
              /* Vertical */
dl.vertical dt{
  font-weight:bold;
  font-size:0.7em;
  margin-top:10px;
}
dl.vertical dd{
  margin:0;
}

/* Horizontal */
dl.horizontal dt{
 float:left;
 font-weight:bold;
}
dl.horizontal dd{
  margin-left:100px;
}

/* Switcher */
ul{
  margin:0;
  padding:0
}
li{
  cursor:pointer;
  display:inline-block;
  padding:0 10px;
  background-color:#ccc;
  line-height:30px;
  color:#555
}
li.selected{
  background-color:#fcc;
  color:#f88;
}
            
          
!
            
              // Make it vertical
$('#v').click(function() {
  $('#list').addClass('vertical');
  $('#list').removeClass('horizontal');
   highlightList(this);
});

// Make it horizontal
$('#h').click(function() {
  $('#list').removeClass('vertical');
  $('#list').addClass('horizontal');
  highlightList(this);
});

// Switcher UI
function highlightList(e) {
  $(e).siblings().removeClass('selected');
  $(e).addClass('selected');
}
  
            
          
!
999px
Loading ..................

Console