css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <section class="case-thumbs">
  <h2 class="case-title">Flex布局</h2>
  <p class="case-intro">支持到IE10</p>
  <div class="thumbs">
    <a class="thumb s-radius" href="#">
      <i class="badge"></i>
      <div class="picture">
        <img src="http://images.wincheers.net/Images/ProductImages/sennheiser-new/L/1990-0006/1990-0006.jpg" alt="Sennheise CX 686G 新品运动耳塞">
      </div>
      <div class="label">
        <span class="title">Sennheise CX 686G 新品运动耳塞</span>
        <span class="price" data-is-round-price="true" data-item-price="649"></span>
      </div>
    </a>
    <a class="thumb s-radius" href="#">
      <i class="badge"></i>
      <div class="picture">
        <img src="http://images.wincheers.net/Images/ProductImages/sennheiser-new/L/1500-0005/1500-0005.jpg" alt="IE80监听耳塞,高保真立体声">
      </div>
      <div class="label">
        <span class="title">IE80监听耳塞,高保真立体声</span>
        <span class="price" data-is-round-price="true" data-item-price="2699"></span>
      </div>
    </a>
    <a class="thumb s-radius" href="#">
      <i class="badge"></i>
      <div class="picture">
        <img src="http://images.wincheers.net/Images/ProductImages/sennheiser-new/L/3240-0001/3240-0001.jpg" alt="Sennheiser 森海塞尔 MOMENTUM In-Ear i Chrome">
      </div>
      <div class="label">
        <span class="title">Sennheiser 森海塞尔 MOMENTUM In-Ear i Chrome</span>
        <span class="price" data-is-round-price="true" data-item-price="749"></span>
      </div>
    </a>

    <a class="thumb s-radius" href="#">
      <i class="badge"></i>
      <div class="picture">
        <img src="http://images.wincheers.net/Images/ProductImages/sennheiser-new/L/4900-0005/4900-0005.jpg" alt="Sennheiser 森海塞尔 MOMENTUM i Ivory M2象牙白">
      </div>
      <div class="label">
        <span class="title">Sennheiser 森海塞尔 MOMENTUM i Ivory M2象牙白</span>
        <span class="price" data-is-round-price="true" data-item-price="2299"></span>
      </div>
    </a>
    <a class="thumb s-radius" href="#">
      <i class="badge"></i>
      <div class="picture">
        <img src="http://images.wincheers.net/Images/ProductImages/sennheiser-new/L/0500-0011/0500-0011.jpg" alt="HD 650手工挑选钕磁单元">
      </div>
      <div class="label">
        <span class="title">HD 650手工挑选钕磁单元</span>
        <span class="price" data-is-round-price="true" data-item-price="2659"></span>
      </div>
    </a>
    <a class="thumb s-radius" href="#">
      <i class="badge"></i>
      <div class="picture">
        <img src="http://images.wincheers.net/Images/ProductImages/sennheiser-new/L/0700-0016/0700-0016.jpg" alt="MX 375 高性能立体声耳塞">
      </div>
      <div class="label">
        <span class="title">MX 375 高性能立体声耳塞</span>
        <span class="price" data-is-round-price="true" data-item-price="189"></span>
      </div>
    </a>
    <a class="thumb s-radius" href="#">
      <i class="badge"></i>
      <div class="picture">
        <img src="http://images.wincheers.net/Images/ProductImages/sennheiser-new/L/1970-0008/1970-0008.jpg" alt="CX 3.00 Black与设备接上及时使用,让你体验细腻声音和强劲的重低音">
      </div>
      <div class="label">
        <span class="title">CX 3.00 Black与设备接上及时使用,让你体验细腻声音和强劲的重低音</span>
        <span class="price" data-is-round-price="true" data-item-price="399"></span>
      </div>
    </a>
  </div>

  
</section>
<section class="case-help">
  <h3>注意:</h3>
  <ol>
    <li>Flex布局支持到IE10及以上的浏览器,有兼容低版本需求的亲可使用Float等方法;</li>
    <li>确定浏览器支持box-shadow的效果。</li>
    <li>页面文字需要看浏览器对font-weight的解读,线条并不完全这么细的,chrome效果最好。</li>
    <li>图片来自网络,仅作demo展示之用,如有侵权请联系pamela@apamy.com删除</li>
  </ol>
</section>
            
          
!
            
              html {
  font-family: 'Microsoft YaHei', Arial, Helvetica, Nimbus Sans, sans-serif;
  font-weight: 300;
  line-height:1.6;
  letter-spacing: 1px;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility !important;
  font-smoothing: antialiased;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: lighter;
}

ol {
  list-style: decimal inside;
  margin-top: 20px;
  margin-bottom: 20px;
}

button {
  border: none;
  cursor: pointer;
  appearance: none;
  background: transparent;
}

a,
a:active,
input,
button,
select,
textarea {
  outline: 0px none;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
}

:focus {
  outline: 0;
}

::-moz-focus-inner {
  border: 0px;
}

img {
  border: none;
  display: inline-block;
  max-width: 100%;
}

.s-radius {
  border-radius: 4px;
}

.case-help {
  margin-left: auto;
  margin-right: auto;
  padding: 40px 30px;
  max-width: 1380px;
  width: 100%;
}

.case-title,
.case-intro {
  text-align: center;
}

.case-title {}

.case-intro {
  margin-top: 20px;
  opacity: .6;
}

.case-thumbs {
  background-color: #f2f2f2;
  padding: 50px 15px;
}

.thumbs {
  margin: 40px auto 0;
  max-width: 1380px;
  width: 100%;
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
}

.thumb {
  display: block;
  margin: 10px;
  max-width: 100%;
  overflow: hidden;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  width: 100%;
  width: calc(100% - 20px);
  color: #666;
  background-color: #fafafa;
  text-decoration: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
  transition-duration: .2s;
  &:hover,
  &:active {
    color: #24B35A;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    .picture {
      img {
        transform: scale(1.1) translate(-45%, -45%);
      }
    }
  }
  .picture {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    background-color: #4d4e53;
    overflow: hidden;
    img {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: scale(1) translate(-50%, -50%);
      transition-duration: 1.2s
    }
  }
  @media (min-width: 768px) {
    max-width: 100%;
    width: 50%;
    width: calc(50% - 20px);
  }
  @media (min-width: 1024px) {
    width: 25%;
    width: calc(25% - 20px);
  }
}

.label {
  padding: 15px;
  align-items: center;
  display: flex;
  justify-content: space-between;
  .title {
    transition: color .4s;
  }
  .price {
    color: #24B35A;
    flex-shrink: 0;
    padding-left: 10px;
    text-align: right;
  }
  .price[data-item-price]:not([data-item-price='']):before {
    content: '\00A5' attr(data-item-price);
  }
}

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console