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

              
                <ol>
  <li>just a box</li>
  <li>svg (complex pattern) in a box</li>
  <li>svg (complex pattern) in an img box</li>
  <li>svg (simple) in a box</li>
  <li>png in an img box</li>
</ol>
<div id="purple-box" class="box" style="background-color:#db00db; margin-right: 2em;"></div>
<div id="svg-box" class="box">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 240 240" enable-background="new 0 0 240 240" xml:space="preserve">
<symbol  id="leaf" viewBox="-117.5 -77.262 235 154.524">
	
		<radialGradient id="SVGID_1_" cx="-43.2896" cy="-106.1586" r="151.8733" gradientTransform="matrix(1 -0.0042 0.0042 1 42.2662 43.0452)" gradientUnits="userSpaceOnUse">
		<stop  offset="0" style="stop-color:#1B1464"/>
		<stop  offset="0.3465" style="stop-color:#0071BC"/>
		<stop  offset="1" style="stop-color:#FFFFFF"/>
	</radialGradient>
	<path fill-rule="evenodd" clip-rule="evenodd" fill="url(#SVGID_1_)" d="M116.145-60.709
		c-19.773-19.613-216.602-23.947-231.989-1.203C-126.641-40.162-83.69,48.077-15.033,53.996
		c4.724,10.612,11.045,23.266,11.045,23.266s3.809-9.856,10.174-22.29C114.204,22.353,121.789-47.427,116.145-60.709z"/>
</symbol>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.2105 0 0 -0.2105 120 23.5)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.2059 -0.0438 -0.0438 -0.2059 99.0939 25.5922)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.1923 -0.0856 -0.0856 -0.1923 79.0797 31.9853)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.1703 -0.1237 -0.1237 -0.1703 60.8321 42.3999)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.1408 -0.1564 -0.1564 -0.1408 45.1485 56.3808)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.1052 -0.1823 -0.1823 -0.1052 32.7144 73.317)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.065 -0.2002 -0.2002 -0.065 24.0733 92.4683)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.022 -0.2093 -0.2093 -0.022 19.6028 112.9976)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.022 -0.2093 -0.2093 0.022 19.4983 134.0078)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.065 -0.2002 -0.2002 0.065 23.7643 154.5807)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.1052 -0.1823 -0.1823 0.1052 32.2144 173.817)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.1408 -0.1564 -0.1564 0.1408 44.4794 190.8761)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.1703 -0.1237 -0.1237 0.1703 60.0231 205.0123)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.1923 -0.0856 -0.0856 0.1923 78.1662 215.608)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.2059 -0.0438 -0.0438 0.2059 98.1158 222.1999)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.2105 0 0 0.2105 119 224.5)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.2059 0.0438 0.0438 0.2059 139.9061 222.4078)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.1923 0.0856 0.0856 0.1923 159.9203 216.0147)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.1703 0.1237 0.1237 0.1703 178.1679 205.6001)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.1408 0.1564 0.1564 0.1408 193.8515 191.6192)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.1052 0.1823 0.1823 0.1052 206.2856 174.683)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.065 0.2002 0.2002 0.065 214.9267 155.5317)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.022 0.2093 0.2093 0.022 219.3972 135.0024)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.022 0.2093 0.2093 -0.022 219.5017 113.9921)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.065 0.2002 0.2002 -0.065 215.2357 93.4193)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.1052 0.1823 0.1823 -0.1052 206.7856 74.183)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.1408 0.1564 0.1564 -0.1408 194.5206 57.1239)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.1703 0.1237 0.1237 -0.1703 178.9769 42.9877)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.1923 0.0856 0.0856 -0.1923 160.8338 32.3921)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.2059 0.0438 0.0438 -0.2059 140.8842 25.8001)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.2105 0 0 -0.2105 120 33.5)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.1923 -0.0856 -0.0856 -0.1923 82.5242 40.1904)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.1408 -0.1564 -0.1564 -0.1408 51.0096 61.5451)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.065 -0.2002 -0.2002 -0.065 30.9054 93.8718)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.022 -0.2093 -0.2093 0.022 25.6877 131.5808)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.1052 -0.1823 -0.1823 0.1052 36.2587 168.1519)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.1703 -0.1237 -0.1237 0.1703 60.7906 197.2617)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.2059 -0.0438 -0.0438 0.2059 95.0416 213.8768)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.2059 0.0438 0.0438 0.2059 133.0895 215.1242)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.1703 0.1237 0.1237 0.1703 168.3553 200.7884)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.1052 0.1823 0.1823 0.1052 194.7413 173.3481)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(-0.022 0.2093 0.2093 0.022 207.6852 137.5479)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.065 0.2002 0.2002 -0.065 204.9487 99.5781)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.1408 0.1564 0.1564 -0.1408 187.0051 66.004)" overflow="visible"/>
<use xlink:href="#leaf"  width="235" height="154.524" x="-117.5" y="-77.262" transform="matrix(0.1923 0.0856 0.0856 -0.1923 156.957 42.6308)" overflow="visible"/>
</svg>
</div>
<div id="svg-img-box" class="box"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/59506/flower-test.svg" width="100%" height="auto"/></div>
<div id="simple-svg-box" class="box"><svg version="1.1" id="em" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 200 200" enable-background="new 0 0 200 200" xml:space="preserve">
<path fill="#CCEEEB" stroke="#00A99D" stroke-width="16" stroke-miterlimit="10" d="M44.898,172.447
	C34.322,142.552-12.034,31.149,45.193,45.604s63.977-0.426,79.351-15.044c17.994-17.109,66.077-31.268,57.227,22.714
	c-8.85,53.982,10.991,99.613-8.555,115.929c-11.385,9.504-62.171-16.735-47.422-55.673s-56.932-30.678-46.608-1.18
	s33.809,68.184-3.316,71.897C49.323,186.902,47.662,180.259,44.898,172.447z"/>
</svg>
</div>
<div id="img-box" class="box"><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/59506/profile.png" width="100%" height="auto"/></div>

              
            
!

CSS

              
                .box{
  width:200px;
  height: 200px;
  float:left;
  -webkit-filter: blur(0px);
  filter: blur(0px);
}

ol {padding:0;}

li {
  width: 200px;
  display:inline-block;
  text-align:center;
  font-family: sans-serif;
  vertical-align: top;
}
              
            
!

JS

              
                var blurElement = {a:0};//start the blur at 0 pixels

TweenMax.to(blurElement, 10, {a:20, onUpdate:applyBlur});

//here you pass the filter to the DOM element
function applyBlur()
{
    TweenMax.set(['.box'], {webkitFilter:"blur(" + blurElement.a + "px)",filter:"blur(" + blurElement.a + "px)"});  
};
              
            
!
999px

Console