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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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

              
                <p>flex-shrink计算,默认为1</p>
<div class="wrap">
	<div class="item">宽度133.33,200-(200*1/200*1+200*1+200*1)*200</div>
	<div class="item">宽度133.33</div>
	<div class="item">宽度133.33</div>
</div>
<p>flex-shrink计算</p>
<div class="wrap">
	<div class="item shrink2">宽度207.7,300-(300*2/300*2+200*3+100*1)*200</div>
	<div class="item shrink3">宽度107.7,200-(200*3/300*2+200*3+100*1)*200</div>
	<div class="item shrink1">宽度84.62,100-(100*1/300*2+200*3+100*1)*200</div>
</div>

              
            
!

CSS

              
                .wrap
	display flex
	border 4px solid #000
	width 400px
	.item
		width 100px
		height 200px
		flex-basis 200px
		word-break:break-all
		&:nth-child(1)
			background #eee
		&:nth-child(2)
			background red
		&:nth-child(3)
			background yellow
		&.shrink2
			flex-basis 300px
			flex-shrink 2
		&.shrink3
			flex-basis 200px
			flex-shrink 3
		&.shrink1
			flex-basis 100px
			flex-shrink 1
              
            
!

JS

              
                
              
            
!
999px

Console