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

              
                <div id="content">
  <div id="chat">只要一个三角形</div>
  <div id="chat-b">第二个三角形叠在第一个三角形上面</div>
  <div id="box">底部不规则阴影</div>
</div>
              
            
!

CSS

              
                body{
  font:0.875em "microsoft Yahei";
  color:#333;
  background:#eee;
}
body,ul,h1,h2,h3,p,input{
  margin:0;
  padding:0
}
div{
  box-sizing:border-box;
}
li{
  list-style:none;
}
a{
  text-decoration:none;
}
.clearfix::after{
  content:"";
  display:block;
  clear:both;
}
#content{
  margin:20px auto;
  padding:0 20px;  
}

#chat,#chat-b{
  position:relative;
  width:180px;
  height:180px;
  background:#62C8A5;
  border-radius:5px;
  float:left;
  margin:0 20px 20px 0;
  padding:10px;
}
#chat:before,#chat-b:before,#chat-b:after{
  content:"";
  position:absolute;
  border-bottom:10px solid #62C8A5;
  border-left:10px solid transparent;
  border-right:10px solid transparent;
  top:-10px;
  left:50%;
  margin-left:-10px;
}
#chat-b{
  background:#eee;
  border:2px solid #62C8A5;
}
#chat-b:after{/*第二个三角形叠在第一个三角形上面。*/
  border-left-width:8px;
  border-right-width:8px;
  border-bottom:8px solid #eee;
  margin-left:-8px;
  top:-8px;
}
#box{
  float:left;
  position:relative;
  margin-bottom:30px;
  width:380px;
  height:180px;
  background:#fff;  
  padding:10px;
}
#box:before,#box:after{
  content:"";
  position:absolute;
  width:150px;
  height:10px;
  box-shadow:0 8px 10px rgba(0,0,0,.5);
  bottom:10px;
  z-index:-1;/*必须设置为负数,才能放在自己父元素之下*/
  background:#000;
  
}
#box:before{
  left:20px;
  transform:skewX(-45deg) rotate(-3deg)
}
#box:after{
  right:20px;
  transform:skewX(45deg) rotate(3deg);
}
              
            
!

JS

              
                
              
            
!
999px

Console