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="spooky"></div>


/* Presets */

*, *:before, *:after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;

:root {
/* Colors */
--purple: #7B5693;
--dark-purple: #14071D;
--gray: #454545;
--pink: #E3C0C0;
--white: #FFFFFF;

body {
  display: flex;
  justify-content: center;
  align-items: start;
  height: 100vh;
  width: 100vw;
  background: radial-gradient(67% 67% at 50% 35%, var(--purple) 0%, var(--dark-purple) 100%)

div:before, div:after {
  display: block;
  content: '';
  position: absolute;

div.spooky {
  background-color: var(--white);
  margin-top: 10vmin;
  height: 45vmin;
  width: 40vmin;
  border-radius: 100% 100% 0 0;

  &:after {
    position: absolute;
      width: 45vmin;
      height: 10vmin;
      bottom: -7vmin;
      left: 0px;
    content: ".";
    font-family: Comic Sans MS;
    font-size: 40vmin;
      /* left eye and cheek */
     3vmin -55vmin 0 var(--pink),               
     21vmin -55vmin 0 var(--pink),
      /* right eye and cheek */
     5.5vmin -62vmin 0 var(--gray),
     18.5vmin -62vmin 0 var(--gray),
      /* mouth */
     12vmin -52vmin 0 var(--white),
     12vmin -51vmin 0 var(--gray);
    height: 15vmin;
    width: 11vmin;
    color: transparent;
    background-color: var(--white);
    border-radius: 100%;
      7vmin 0 0 var(--white),
      14vmin 0 0 var(--white),
      22vmin 0 0 var(--white),
      29vmin 0 0 var(--white);
  &:before {
    width: 30vmin;
    height: 10vmin;
    position: absolute;
    bottom: -30vmin;
    left: 20vmin;
    background-color: var(--dark-purple);
    border-radius: 50%;
    transform: translateX(-50%);

/* Animation */
div.spooky {
  animation: float 3s ease-out infinite;
  &:before {
      shrink 3s ease-out infinite,
      floatUp 3s ease-out infinite;

/* Float up and down */
@keyframes float{
    transform: translate(0, 20px);

/* Keep shadow from floating up */
@keyframes floatUp{
    transform: translate(-50%, -10px);

/* Expand / contract shadow */
@keyframes shrink {
    width: 100%;
    width: 90%
    width: 100%;


                /* This entry for #divtober 2022 was adapted from a forked copy of the brilliant cute-little-ghost animation by Anastasia Goodwin  that I had been using to practice learning CSS Art. There is a time-lapse video of making this piece at */