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

              
                <canvas id="canvas" width="1920" height="1080"></canvas>
<img id="svg" src="data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' height='33' width='49'%3e%3cdefs%3e%3cclipPath id='a'%3e%3cpath d='M0 1.8h370v250H0z'%3e%3c/path%3e%3c/clipPath%3e%3c/defs%3e%3cg clip-path='url(%23a)' transform='matrix(.13333 0 0 -.13333 0 33.573)'%3e%3cpath d='M369.813 178.285c0-39.504-82.34-71.527-183.883-71.527C84.348 106.758 2 138.781 2 178.285V73.515C2 34.02 84.348 1.993 185.93 1.993c101.543 0 183.883 32.027 183.883 71.524v104.769' fill='%23087bbb'%3e%3c/path%3e%3cpath d='M369.813 178.285c0-39.504-82.34-71.527-183.883-71.527C84.348 106.758 2 138.781 2 178.285V73.515C2 34.02 84.348 1.993 185.93 1.993c101.543 0 183.883 32.027 183.883 71.524z' fill='none' stroke='%23fff' stroke-width='4'%3e%3c/path%3e%3cpath d='M185.93 106.758c101.543 0 183.883 32.023 183.883 71.527s-82.34 71.524-183.883 71.524C84.348 249.809 2 217.789 2 178.285s82.348-71.527 183.93-71.527' fill='%23087bbb'%3e%3c/path%3e%3cpath d='M185.93 106.758c101.543 0 183.883 32.023 183.883 71.527s-82.34 71.524-183.883 71.524C84.348 249.809 2 217.789 2 178.285s82.348-71.527 183.93-71.527z' fill='none' stroke='%23fff' stroke-width='4'%3e%3c/path%3e%3cpath d='M143.926 206.254l15.183-22.785-57.421-13.274 12.55 10.453-88.75 15.165 22.266 16.691L133.39 198l10.535 8.254M224.695 151.008l-10.371 23.48 51.797 10.356-8.98-8.051 86.328-14.738-20.703-16.575-85.825 16.114-12.246-10.586M196.406 218.688l57.981 15.882.679-24.863-14.492 2.766-28.301-23.485-27 3.938 29.192 22.976-18.059 2.786M171.543 129.594l-55.242-10.356-2.071 25.551 15.875-3.449 30.415 25.965 26.914-4.555-32.461-28.316 16.57-4.84M268.879 53.95c0-22.665-35.742-41.04-79.777-41.04-44.075 0-79.793 18.375-79.793 41.04 0 22.667 35.718 41.046 79.793 41.046 44.035 0 79.777-18.379 79.777-41.047' fill='%23fff'%3e%3c/path%3e%3cpath d='M140.203 47.36l24.668 24.671-12.066 12.074 37.261 2.618-2.086-37.801-13.125 13.129-24.679-24.672-9.973 9.98' fill='%23087bbb'%3e%3c/path%3e%3cpath d='M140.203 47.36l24.668 24.671-12.066 12.074 37.261 2.618-2.086-37.801-13.125 13.129-24.679-24.672z' fill='none' stroke='%23fff' stroke-width='4'%3e%3c/path%3e%3cpath d='M184.539 27.438l24.672 24.675-12.07 12.078 37.246 2.618-2.09-37.801-13.149 13.125-24.628-24.676-9.981 9.98' fill='%23087bbb'%3e%3c/path%3e%3cpath d='M184.539 27.438l24.672 24.675-12.07 12.078 37.246 2.618-2.09-37.801-13.149 13.125-24.628-24.676z' fill='none' stroke='%23fff' stroke-width='4'%3e%3c/path%3e%3c/g%3e%3c/svg%3e">
              
            
!

CSS

              
                img {
  display: none
}
              
            
!

JS

              
                const ctx = canvas.getContext('2d')
const image = document.querySelector('img')

ctx.setTransform(100,0,0,100,10,10)

canvas.getContext('2d').drawImage(image, 0, 0, 10, 10);

              
            
!
999px

Console