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

              
                <ul>
  <li>
    <div class="title">杂技团美女演员的训练</div>
    <div class="date">2008-03-14</div>
  </li>
  <li>
    <div class="title">最昂贵内衣惊艳出炉</div>
    <div class="date">2008-03-14</div>
  </li>
  <li>
    <div class="title">【组图】让人喷饭的日常用品大</div>
    <div class="date">2008-03-14</div>
  </li>
  <li>
    <div class="title">世界上头发最长的美女人叹为观止</div>
    <div class="date">2008-03-14</div>
  </li>
  <li>
    <div class="title">世界八大最喜欢吃人的恐怖生物是什么?</div>
    <div class="date">2008-03-14</div>
  </li>
  <li>
    <div class="title">体育比赛中让人惊奇的奇妙瞬间,值得你记住</div>
    <div class="date">2008-03-14</div>
  </li>
  <li>
    <div class="title">独家新闻:虹虹顺利产下龙凤胎</div>
    <div class="date">2008-03-14</div>
  </li>
  <li>
    <div class="title">亿万富翁们的超级奢侈</div>
    <div class="date">2008-03-14</div>
  </li>
  <li>
    <div class="title">“日本小姐”选美</div>
    <div class="date">2008-03-14</div>
  </li>
  <li>
    <div class="title">素面朝天吥坏人,化妆前后大对比</div>
    <div class="date">2008-03-14</div>
  </li>
</ul>
              
            
!

CSS

              
                * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 100vw;
  min-height: 100vh;
  padding: 2vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

ul {
  border: 1px solid #f66604;
  padding: 10px;
  list-style: none outside none;
  width: 400px;
}

li {
  display: flex;
  align-items: center;
  counter-increment: list;
  width: 100%;
  
  &::before {
    content: counter(list);
    display: inline-flex;
    justify-content: center;
    aligin-items: center;
    border-radius: 3px;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
    color: #fff;
    background: #f66604;
    padding:10px;
    min-width:15px;
    min-height: 15px;
  }
  
  + li {
    margin-top: 10px;
  }
}

.title {
  margin: 0 10px;
  font-size: 18px;
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date {
  white-space: nowrap;
  font-size: 14px;
  color: #333;
}
              
            
!

JS

              
                
              
            
!
999px

Console