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

              
                <div></div>
<p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Voluptatem laborum esse adipisci aperiam obcaecati veniam, facilis iste, cupiditate corrupti, ad alias voluptatibus veritatis quae aliquam. Perspiciatis neque labore dolorem ullam.
  Laborum, sequi. Tenetur aspernatur amet maiores sit possimus, nihil doloremque consequuntur! Neque, suscipit laborum! Accusamus, sint perspiciatis iure ipsa velit necessitatibus aliquam numquam debitis nisi repudiandae nemo laborum exercitationem distinctio?
  Voluptatum deleniti quasi corrupti consequuntur, iure unde dicta pariatur blanditiis in officiis ab itaque iusto vero praesentium amet ipsa aperiam quo eligendi corporis nulla minus numquam veritatis rem! Nemo, fuga?
  Quos nulla quae numquam tempore perferendis tenetur, sequi magni iste odit, eius molestias sit enim, amet reiciendis laborum accusamus facere voluptatem! Delectus sit quia libero amet sint! Temporibus, fugiat distinctio!
  Ipsam, ullam placeat? Corporis exercitationem eius dolores, nulla enim temporibus amet repellendus accusantium suscipit esse non qui similique. Laboriosam sunt sapiente voluptate nihil voluptates rerum facilis itaque aspernatur, optio sint.</p>
              
            
!

CSS

              
                body {
  background: #001c30;
  color: #dafffb;
}
div,
div::after {
  background: #176b87;
  width: 100px;
  height: 100px;
  position: fixed;
  left: 30%;
  top: calc(50% - 50px);
  border-radius: 50%;
}

div::after {
  content: "";
  position: absolute;
  background: #64ccc5;
  width: 30px;
  height: 30px;
  left: 100%;
}
p {
  width: 20%;
}

              
            
!

JS

              
                const planet = document.querySelector("div");
window.addEventListener("scroll", function () {
  const scrollY = window.scrollY;
  planet.style.transform = `translateX(${scrollY * 0.3}vw) rotate(${
    scrollY * 3
  }deg)`;
});

              
            
!
999px

Console