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

Auto Save

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

              
                <header>
  <h1>CSS is awesome!</h1>
</header>

<section>
  <h2>Welcome to the dark side of the CSS</h2>
  <p>Ширина body здесь всего 400px (подсвечена рамкой при наведении).</p>
  <p>А фон каждого раздела растянут до краев окна.</p>
  <p>И никакого горизонтального скроллинга, как могло бы быть с псевдоэлементами.</p>
</section>

<footer>
  <p>body is only 400px wide!</p>
  <p><a href="https://commons.wikimedia.org/wiki/File:MarsPanoramaa.jpg">Image</a> from Wikimedia</p>
</footer>
              
            
!

CSS

              
                header {
  border-image: radial-gradient(100% 100% at 80% 0%, #003 98.6%, gold 99% 99.6%, transparent 100%) 0 49.99% fill / 0 55vw / 2em calc(55vw - 200px);
}

section {
  margin: 20vw 0;
  border-image: conic-gradient(from 265deg at 135%, transparent, blue 0.1deg 9.9deg, transparent 10deg) 49.99% fill / 44vw 55vw / 40vw calc(55vw - 200px);
}

footer {
  border-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/f/f9/MarsPanoramaa.jpg/1280px-MarsPanoramaa.jpg) 49.99% fill / 50% 55vw / 10vw calc(55vw - 200px);
  --mask: linear-gradient(-5deg, blue 60%, transparent 60.3%) 100% 49.9% fill / 150% 50% 0/ 10vw 55vw 1em;
  -webkit-mask-box-image: var(--mask);
  mask-border: var(--mask);
  font-size: 50%;
}

body {
  width: 400px;
  margin: auto;
  font: 1.5em / 1.5 sans-serif;
  color: #fff;
  background: conic-gradient(at 1px 19px,#000 25%, #333 0) 0 0/20px 20px fixed
}

body:hover {
  outline: 2px dashed red;
}

a {
  color: gold;
}
              
            
!

JS

              
                
              
            
!
999px

Console