Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

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

              
                <!--
已知浮动是元素脱离了普通文档流;如果当前空间允许,则其后的元素会向上提升至与其平起平坐。

然而,浮动有一个明显的缺陷:包围浮动的父元素会产生高度坍塌。

那么,如何清除浮动?请尽可能的写出清除浮动的多种方式,并说明哪一种最合适?
-->
<section>
  <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1550750988751&di=62a1a86adc35c6a0c83d309aba1806ac&imgtype=0&src=http%3A%2F%2Fi1.hdslb.com%2Fbfs%2Fface%2F18ce9edfe5a36ea16a1817b616e728a23d170e27.jpg">
  <p>这是一只猫</p>
</section>
              
            
!

CSS

              
                section{
  border: 1px solid blue;
  margin: 0 0 10px 0;
}
img{
  float: left;
}
p{
  margin:0;
  font-size:1em;
}
              
            
!

JS

              
                
              
            
!
999px

Console