Pen Settings



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


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


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.


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.


                <div class="control">
  <label for="angle">Angle:</label>
  <input type="range" id="angle" name="angle" value="0" min="0" max="360" step="1" />
  <output id="output">0deg</output>

<div class="control">
  <label for="position">position:</label>
  <select name="position" id="position">
    <optgroup label="bg-position">
      <option value="top">top</option>
      <option value="right">right</option>
      <option value="bottom">bottom</option>
      <option value="left">left</option>
      <option value="center" selected>center</option>
      <option value="top left">top left</option>
      <option value="top center">top center</option>
      <option value="top right">top right</option>
      <option value="center center">center center</option>
      <option value="center right">center right</option>
      <option value="left center">let center</option>
      <option value="bottom left">bottom left</option>
      <option value="bottom center">bottom center</option>
      <option value="bottom right">bottom right</option>
    <optgroup label="length-percentage">
      <option value="10px 50px">10px 50px</option>
      <option value="10em 50em">10em 50em</option>
      <option value="10rem 50rem">10rem 50rem</option>
      <option value="10vw 50vw">10vw 50vw</option>
      <option value="10vh 50vh">10vh 50vh</option>
      <option value="10% 50%">10% 50%</option>
      <option value="10%">10%</option>
      <option value="10px 50%">10px 50%</option>
      <option value="10% 50px">10% 50px</option>


                @import url("");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;

body {
  width: 100vw;
  min-height: 100vh;
  font-family: "Exo", Arial, sans-serif;
  background-color: #222;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;

:root {
  --angle: 0deg;
  --position: center;
body {
  background-image: conic-gradient(
    from var(--angle) at var(--position),

.control {
  margin: 0 5px;



                const rootElement = document.documentElement;
const angleInput = document.getElementById("angle");
const angleOutput = document.getElementById("output");
const position = document.getElementById("position");

angleInput.addEventListener("input", (etv) => {"--angle", `${}deg`);
  angleOutput.innerText = `${}deg`;

position.addEventListener("change", (etv) => {"--position",;