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

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

              
                <div class="demo">
  <div id="width-change"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="sun-burst" viewBox="0 0 473 473" class="injected-svg inject-me" data-src="svg/sun-burst.svg" preserveAspectRatio="xMinYMin slice">
	<path fill="#FF7D62" d="M236.091,470.087c-0.01,0-0.021,0-0.031,0c-2.227,0-4.498-0.092-6.738-0.156l6.664-233.25   c0.064,0.002,0.125-0.013,0.168-0.015l6.906,233.266C240.747,470.001,238.403,470.087,236.091,470.087z M215.547,469.073   c-4.579-0.4-9.206-0.943-13.75-1.613l33.997-230.624l-0.056,0.165l-47.62,228.025c-4.517-0.943-9.065-2.036-13.519-3.247   l61.021-224.427l-74.344,220.373c-4.389-1.48-8.79-3.113-13.08-4.853l87.521-215.878l0.081-0.298L135.46,447.263   c-4.162-1.984-8.32-4.12-12.359-6.349L235.803,236.68l0.012-0.043l-0.007,0.036l0.02-0.036l-0.004,0.009l-0.01,0.113l0.043-0.108   l-0.047,0.138L215.547,469.073z M256.825,469.054l-20.561-232.408l34.314,230.781C266.035,468.101,261.407,468.648,256.825,469.054   z M284.257,464.978l-47.903-228.203l-0.046-0.132l0.029,0.052l-0.012-0.056l0.019,0.068L349.16,440.851   c-4.034,2.229-8.188,4.365-12.343,6.35L236.351,236.73l0.011,0.042l87.763,216.031c-4.279,1.739-8.666,3.37-13.04,4.851   l-74.687-220.748l61.377,224.812C293.323,462.933,288.776,464.029,284.257,464.978z M111.147,433.847   c-3.888-2.458-7.753-5.064-11.489-7.747l136.096-189.511L111.147,433.847z M361.069,433.802L236.357,236.613L372.56,426.049   C368.821,428.735,364.954,431.345,361.069,433.802z M88.653,417.693c-3.566-2.896-7.092-5.935-10.48-9.033l157.476-172.157   c0.017,0.016,0.035,0.032,0.055,0.047L88.653,417.693z M383.54,417.654L236.445,236.548c0.021-0.016,0.208-0.032,0.228-0.049   l0.414,0.267c0-0.05,0-0.101,0-0.151l-0.353-0.176c0.016-0.016-0.382-0.033-0.368-0.05l-0.279,0.116c0-0.039,0-0.078,0-0.117   l-0.082-0.062l0.082,0.056c0-0.036,0-0.071,0-0.107l-0.02-0.003l0.02,0.002c0-0.005,0-0.01,0-0.016l-0.019-0.006l0.019,0.005   c0-0.005,0-0.01,0-0.014l-0.018-0.01l0.018,0.009c0-0.014,0-0.028,0-0.042v0c0-0.025,0-0.111,0-0.111h0.652   c0.002,0-0.652-0.01-0.652-0.052c0-0.07,0,0.052,0,0.052h0.651c-0.001,0-0.331-0.187-0.332-0.196l-0.319-0.131   c0-0.004,0-0.008,0-0.012l0.32,0.003l0.172-0.004l0,0l-0.254,0.002l-0.238-0.003c0-0.002,0-0.004,0-0.007l-0.012,0.002l0.012-0.003   c0-0.001,0-0.003,0-0.005l0.356-0.002l207.422-107.056c2.116,4.096,4.219,8.312,6.089,12.528l-213.211,94.524l0.035-0.003   l218.495-81.663c1.614,4.318,3.126,8.745,4.48,13.156l-222.891,68.491l226.588-55.052c1.086,4.473,2.054,9.041,2.874,13.576   l-229.526,41.672l-0.015,0.181h0.171l231.433-27.948c0.547,4.555,0.965,9.28,1.242,13.869l-231.363,14.079H353.4l116.658-0.158   l-0.002-0.659l0.003,0.756c0,4.577-0.136,9.184-0.401,13.736l-222.775-13.038l-6.04,0.036l227.605,26.732   c-0.536,4.561-1.219,9.168-2.025,13.699l-226.932-40.428l-0.621,0.004l224.695,54.071c-1.078,4.476-2.305,9.14-3.648,13.55   l-221.488-67.303h-0.142l217.161,80.533c-1.611,4.34-3.377,8.609-5.246,12.846l-212.155-93.652l-0.264-0.018l206.434,106.141   c-2.11,4.104-4.374,8.35-6.727,12.324L237.646,237.087h-0.312l192.746,129.881c-2.571,3.809-5.293,7.67-8.088,11.325   L237.255,237.087h-0.191l176.209,151.859c-3.001,3.478-6.145,6.835-9.346,10.131L236.916,236.82l-0.155-0.019l157.251,171.833   C390.626,411.732,387.103,414.761,383.54,417.654z M68.253,399.034c-3.194-3.287-6.333-6.715-9.33-10.186L235.528,236.38   c0.02,0.022,0.04,0.045,0.061,0.065L68.253,399.034z M50.201,378.122c-2.794-3.65-5.514-7.432-8.086-11.239l193.338-130.602   L50.201,378.122z M34.706,355.185c-2.346-3.959-4.602-8.038-6.708-12.125l207.3-106.786l-0.077,0.024L22.013,330.542   c-1.864-4.217-3.625-8.545-5.234-12.862l218.245-81.322L12.31,304.494c-1.351-4.415-2.586-8.929-3.671-13.415l226.579-54.793   l0.182-0.068L5.775,277.474c-0.814-4.534-1.502-9.152-2.046-13.728l231.675-27.53l0.007-0.067l0.005-0.062h-0.003h0.003   l-0.07,0.104l0.073,0.015l-0.089,0.043L34.706,355.185z M2.503,249.98c-0.271-4.565-0.411-9.199-0.415-13.773l233.315-0.199   c0,0.043,0.002,0.084,0.004,0.126L2.503,249.98z M235.407,235.844L2.474,222.474c0.263-4.576,0.665-9.202,1.195-13.751   l231.703,27.017l-0.055-0.023L5.686,194.989c0.807-4.549,1.761-9.131,2.836-13.621l226.738,54.329L12.166,167.945   c1.343-4.423,2.839-8.867,4.445-13.207l218.582,80.923L21.839,141.818c1.861-4.23,3.874-8.46,5.984-12.573l207.48,106.457   l0.113,0.032l-0.054-0.01l0.05,0.019l-0.075-0.023l0.077,0.025C235.411,235.776,235.409,235.81,235.407,235.844z M236.721,235.725   l193.165-130.859c2.58,3.808,5.078,7.744,7.428,11.698L236.721,235.725z M235.446,235.691L34.524,117.086   c2.341-3.964,4.833-7.912,7.408-11.734L235.446,235.691z M236.678,235.66c-0.03-0.04-0.051-0.064-0.061-0.075L413.062,82.929   c2.994,3.461,5.928,7.061,8.721,10.7L236.678,235.66z M235.483,235.641L50.005,94.099c2.79-3.656,5.725-7.274,8.722-10.756   l176.795,152.25C235.51,235.607,235.497,235.624,235.483,235.641z M236.563,235.525c-0.022-0.022-0.043-0.042-0.062-0.06   L393.784,63.134c3.387,3.09,6.727,6.324,9.93,9.613L236.563,235.525z M235.588,235.52L68.042,73.148   c3.196-3.297,6.532-6.543,9.917-9.646l157.679,171.97C235.621,235.487,235.604,235.504,235.588,235.52z M235.703,235.415   L88.412,54.469c3.561-2.898,7.255-5.729,10.98-8.412l136.363,189.318C235.738,235.388,235.721,235.4,235.703,235.415z    M236.442,235.415c-0.024-0.02-0.041-0.033-0.052-0.04L372.288,45.722c3.733,2.675,7.438,5.499,11.012,8.394L236.442,235.415z    M236.347,235.345L348.839,30.938c4.033,2.221,8.053,4.592,11.947,7.048L236.347,235.345z M235.821,235.332L110.855,38.304   c3.89-2.466,7.902-4.847,11.927-7.076L235.821,235.332z M236.322,235.326l0.009-0.063l-0.02,0.059l0.024-0.09l-0.04,0.084   l0.043-0.107l33.768-230.74c4.566,0.668,9.172,1.483,13.687,2.421L236.36,235.14l60.959-225.016   c4.455,1.207,8.936,2.565,13.312,4.036L236.4,235.058l87.316-216.06c4.285,1.731,8.573,3.615,12.745,5.598L236.356,235.19   L236.322,235.326z M235.826,235.326l-0.036-0.121l0.033,0.121l-0.061-0.177L135.099,24.875c4.157-1.99,8.429-3.881,12.695-5.619   l87.908,215.715l-74.88-220.577c4.376-1.486,8.854-2.858,13.311-4.08l61.639,224.832l0.031,0.076L187.652,7.037   c4.51-0.951,9.11-1.78,13.672-2.462l34.489,230.671l0.03,0.073l-0.027-0.057L235.826,235.326z M235.875,235.32L215.079,2.933   c4.553-0.407,9.182-0.685,13.76-0.825l7.153,233.206C235.949,235.315,235.909,235.317,235.875,235.32z M236.266,235.32   c-0.034-0.002-0.07-0.005-0.11-0.006l6.427-233.228c4.579,0.127,9.213,0.39,13.771,0.784L236.266,235.32z"></path>
</svg></div>
</div>

<div class="demo2">
<div id="scale-change"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="sun-burst" viewBox="0 0 473 473" class="injected-svg inject-me" data-src="svg/sun-burst.svg" preserveAspectRatio="xMinYMin slice">
	<path fill="#FF7D62" d="M236.091,470.087c-0.01,0-0.021,0-0.031,0c-2.227,0-4.498-0.092-6.738-0.156l6.664-233.25   c0.064,0.002,0.125-0.013,0.168-0.015l6.906,233.266C240.747,470.001,238.403,470.087,236.091,470.087z M215.547,469.073   c-4.579-0.4-9.206-0.943-13.75-1.613l33.997-230.624l-0.056,0.165l-47.62,228.025c-4.517-0.943-9.065-2.036-13.519-3.247   l61.021-224.427l-74.344,220.373c-4.389-1.48-8.79-3.113-13.08-4.853l87.521-215.878l0.081-0.298L135.46,447.263   c-4.162-1.984-8.32-4.12-12.359-6.349L235.803,236.68l0.012-0.043l-0.007,0.036l0.02-0.036l-0.004,0.009l-0.01,0.113l0.043-0.108   l-0.047,0.138L215.547,469.073z M256.825,469.054l-20.561-232.408l34.314,230.781C266.035,468.101,261.407,468.648,256.825,469.054   z M284.257,464.978l-47.903-228.203l-0.046-0.132l0.029,0.052l-0.012-0.056l0.019,0.068L349.16,440.851   c-4.034,2.229-8.188,4.365-12.343,6.35L236.351,236.73l0.011,0.042l87.763,216.031c-4.279,1.739-8.666,3.37-13.04,4.851   l-74.687-220.748l61.377,224.812C293.323,462.933,288.776,464.029,284.257,464.978z M111.147,433.847   c-3.888-2.458-7.753-5.064-11.489-7.747l136.096-189.511L111.147,433.847z M361.069,433.802L236.357,236.613L372.56,426.049   C368.821,428.735,364.954,431.345,361.069,433.802z M88.653,417.693c-3.566-2.896-7.092-5.935-10.48-9.033l157.476-172.157   c0.017,0.016,0.035,0.032,0.055,0.047L88.653,417.693z M383.54,417.654L236.445,236.548c0.021-0.016,0.208-0.032,0.228-0.049   l0.414,0.267c0-0.05,0-0.101,0-0.151l-0.353-0.176c0.016-0.016-0.382-0.033-0.368-0.05l-0.279,0.116c0-0.039,0-0.078,0-0.117   l-0.082-0.062l0.082,0.056c0-0.036,0-0.071,0-0.107l-0.02-0.003l0.02,0.002c0-0.005,0-0.01,0-0.016l-0.019-0.006l0.019,0.005   c0-0.005,0-0.01,0-0.014l-0.018-0.01l0.018,0.009c0-0.014,0-0.028,0-0.042v0c0-0.025,0-0.111,0-0.111h0.652   c0.002,0-0.652-0.01-0.652-0.052c0-0.07,0,0.052,0,0.052h0.651c-0.001,0-0.331-0.187-0.332-0.196l-0.319-0.131   c0-0.004,0-0.008,0-0.012l0.32,0.003l0.172-0.004l0,0l-0.254,0.002l-0.238-0.003c0-0.002,0-0.004,0-0.007l-0.012,0.002l0.012-0.003   c0-0.001,0-0.003,0-0.005l0.356-0.002l207.422-107.056c2.116,4.096,4.219,8.312,6.089,12.528l-213.211,94.524l0.035-0.003   l218.495-81.663c1.614,4.318,3.126,8.745,4.48,13.156l-222.891,68.491l226.588-55.052c1.086,4.473,2.054,9.041,2.874,13.576   l-229.526,41.672l-0.015,0.181h0.171l231.433-27.948c0.547,4.555,0.965,9.28,1.242,13.869l-231.363,14.079H353.4l116.658-0.158   l-0.002-0.659l0.003,0.756c0,4.577-0.136,9.184-0.401,13.736l-222.775-13.038l-6.04,0.036l227.605,26.732   c-0.536,4.561-1.219,9.168-2.025,13.699l-226.932-40.428l-0.621,0.004l224.695,54.071c-1.078,4.476-2.305,9.14-3.648,13.55   l-221.488-67.303h-0.142l217.161,80.533c-1.611,4.34-3.377,8.609-5.246,12.846l-212.155-93.652l-0.264-0.018l206.434,106.141   c-2.11,4.104-4.374,8.35-6.727,12.324L237.646,237.087h-0.312l192.746,129.881c-2.571,3.809-5.293,7.67-8.088,11.325   L237.255,237.087h-0.191l176.209,151.859c-3.001,3.478-6.145,6.835-9.346,10.131L236.916,236.82l-0.155-0.019l157.251,171.833   C390.626,411.732,387.103,414.761,383.54,417.654z M68.253,399.034c-3.194-3.287-6.333-6.715-9.33-10.186L235.528,236.38   c0.02,0.022,0.04,0.045,0.061,0.065L68.253,399.034z M50.201,378.122c-2.794-3.65-5.514-7.432-8.086-11.239l193.338-130.602   L50.201,378.122z M34.706,355.185c-2.346-3.959-4.602-8.038-6.708-12.125l207.3-106.786l-0.077,0.024L22.013,330.542   c-1.864-4.217-3.625-8.545-5.234-12.862l218.245-81.322L12.31,304.494c-1.351-4.415-2.586-8.929-3.671-13.415l226.579-54.793   l0.182-0.068L5.775,277.474c-0.814-4.534-1.502-9.152-2.046-13.728l231.675-27.53l0.007-0.067l0.005-0.062h-0.003h0.003   l-0.07,0.104l0.073,0.015l-0.089,0.043L34.706,355.185z M2.503,249.98c-0.271-4.565-0.411-9.199-0.415-13.773l233.315-0.199   c0,0.043,0.002,0.084,0.004,0.126L2.503,249.98z M235.407,235.844L2.474,222.474c0.263-4.576,0.665-9.202,1.195-13.751   l231.703,27.017l-0.055-0.023L5.686,194.989c0.807-4.549,1.761-9.131,2.836-13.621l226.738,54.329L12.166,167.945   c1.343-4.423,2.839-8.867,4.445-13.207l218.582,80.923L21.839,141.818c1.861-4.23,3.874-8.46,5.984-12.573l207.48,106.457   l0.113,0.032l-0.054-0.01l0.05,0.019l-0.075-0.023l0.077,0.025C235.411,235.776,235.409,235.81,235.407,235.844z M236.721,235.725   l193.165-130.859c2.58,3.808,5.078,7.744,7.428,11.698L236.721,235.725z M235.446,235.691L34.524,117.086   c2.341-3.964,4.833-7.912,7.408-11.734L235.446,235.691z M236.678,235.66c-0.03-0.04-0.051-0.064-0.061-0.075L413.062,82.929   c2.994,3.461,5.928,7.061,8.721,10.7L236.678,235.66z M235.483,235.641L50.005,94.099c2.79-3.656,5.725-7.274,8.722-10.756   l176.795,152.25C235.51,235.607,235.497,235.624,235.483,235.641z M236.563,235.525c-0.022-0.022-0.043-0.042-0.062-0.06   L393.784,63.134c3.387,3.09,6.727,6.324,9.93,9.613L236.563,235.525z M235.588,235.52L68.042,73.148   c3.196-3.297,6.532-6.543,9.917-9.646l157.679,171.97C235.621,235.487,235.604,235.504,235.588,235.52z M235.703,235.415   L88.412,54.469c3.561-2.898,7.255-5.729,10.98-8.412l136.363,189.318C235.738,235.388,235.721,235.4,235.703,235.415z    M236.442,235.415c-0.024-0.02-0.041-0.033-0.052-0.04L372.288,45.722c3.733,2.675,7.438,5.499,11.012,8.394L236.442,235.415z    M236.347,235.345L348.839,30.938c4.033,2.221,8.053,4.592,11.947,7.048L236.347,235.345z M235.821,235.332L110.855,38.304   c3.89-2.466,7.902-4.847,11.927-7.076L235.821,235.332z M236.322,235.326l0.009-0.063l-0.02,0.059l0.024-0.09l-0.04,0.084   l0.043-0.107l33.768-230.74c4.566,0.668,9.172,1.483,13.687,2.421L236.36,235.14l60.959-225.016   c4.455,1.207,8.936,2.565,13.312,4.036L236.4,235.058l87.316-216.06c4.285,1.731,8.573,3.615,12.745,5.598L236.356,235.19   L236.322,235.326z M235.826,235.326l-0.036-0.121l0.033,0.121l-0.061-0.177L135.099,24.875c4.157-1.99,8.429-3.881,12.695-5.619   l87.908,215.715l-74.88-220.577c4.376-1.486,8.854-2.858,13.311-4.08l61.639,224.832l0.031,0.076L187.652,7.037   c4.51-0.951,9.11-1.78,13.672-2.462l34.489,230.671l0.03,0.073l-0.027-0.057L235.826,235.326z M235.875,235.32L215.079,2.933   c4.553-0.407,9.182-0.685,13.76-0.825l7.153,233.206C235.949,235.315,235.909,235.317,235.875,235.32z M236.266,235.32   c-0.034-0.002-0.07-0.005-0.11-0.006l6.427-233.228c4.579,0.127,9.213,0.39,13.771,0.784L236.266,235.32z"></path>
</svg></div>
</div>

              
            
!

CSS

              
                body {
  background-color: #ccc;
}

.demo, .demo2, .demo3 {
 position: absolute;
  width:100px;
  height:100px;
  border: 1px dashed red;
}
.demo { left: 50px; top: 50px;}

.demo2 { right: 50px; top: 50px;}

svg {
  width: 100%; 
  height: auto;
}
svg#sun-burst3 {position: absolute;}

button {
  padding:10px;
  margin:10px;
}
              
            
!

JS

              
                var tl = new TimelineLite()

tl.to("#width-change", 1, {width: "1000%", marginLeft: "-450%", marginTop: "-450%" });



tl.to("#scale-change", 1, {scale: 10, transformOrigin: "50% 50%"});

              
            
!
999px

Console