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.

            
              <body>
  <h1>Aligning list-markers with list-style-position</h1>
  <p>Recently I’ve stumpled upon a CSS property, that exists like forever (since IE4 to be exact). To indent a list, I’ve always used margin-left without giving further thoughts to it.</p>
  <p>I hit the limits when I combined it with CSS3 columns and found <b>list-style-position:inside</b> which is of course the way to go.</p>
  <div class="wrapper wrapper-highlight">
    <h2 class="highlight">Thanks, list-style-position:inside!</h2>
    <p>Nec fusce eu fusce parturient duis massa inceptos adipiscing.</p>
    <ul class="list-reset list-indent list-cols">
      <li>Lorem</li>
      <li>Ipsum</li>
      <li>Dolor</li>
      <li>Sit</li>
      <li>Amet</li>
      <li>Lorem</li>
    </ul>
  </div>
  
  <div class="wrapper">
    <h2>Here's what I've started with:</h2>
    <p>Nec fusce eu fusce parturient duis massa inceptos adipiscing.</p>
    <ul class="list-reset">
      <li>Lorem</li>
      <li>Ipsum</li>
      <li>Dolor</li>
      <li>Sit</li>
      <li>Amet</li>
      <li>Lorem</li>
    </ul>
  </div>
  
  <div class="wrapper">
    <h2>Align workes on first sight:</h2>
    <p>Nec fusce eu fusce parturient duis massa inceptos adipiscing.</p>
    <ul class="list-reset list-indent-margin">
      <li>Lorem</li>
      <li>Ipsum</li>
      <li>Dolor</li>
      <li>Sit</li>
      <li>Amet</li>
      <li>Lorem</li>
    </ul>
  </div>
  
  <div class="wrapper">
    <h2>Whoopsa, using columns:</h2>
    <p>Nec fusce eu fusce parturient duis massa inceptos adipiscing.</p>
    <ul class="list-reset list-indent-margin list-cols">
      <li>Lorem</li>
      <li>Ipsum</li>
      <li>Dolor</li>
      <li>Sit</li>
      <li>Amet</li>
      <li>Lorem</li>
    </ul>
  </div>
  
</body>
            
          
!
            
              @import "compass/css3";

body {
  font-family: Helvetica, Arial, sans;
  font-size: 14px;
}
p {
  max-width: 40em;
  line-height: 1.3em;
}

.wrapper {
  max-width: 370px;
  padding: 1em;
  background-color: lighten(#332F30, 60%);
  margin-bottom: 1em;
  margin-right: 1em;
  float: left;
  box-sizing: border-box;
}

.wrapper-highlight {
  border: 3px solid #ff41a2;
  float:none;
  clear:both;
}

.highlight {
  color: #ff41a2;
}

.list-reset {
  margin: 0;
  padding: 0;
}

.list-indent-margin {
  margin-left: 1em;
}
.list-indent {
  list-style-position:inside;
}

.list-cols {
  column-count: 2;
  -moz-column-count: 2;
  -webkit-column-count: 2;
}
            
          
!
999px
Loading ..................

Console