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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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