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 class="cartoon hb thin-border">
  <div class="water-lines ha"></div>
  <div class="bottle b ha hb"></div>
  <div class="neck"></div>
  <div class="cap b ha"></div>
</div>
              
            
!

CSS

              
                .cartoon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80vmin;
  height: 80vmin;
  abackground-color: #eee;
  abackground-image: linear-gradient(to right, transparent 99%, gray 0), linear-gradient(to bottom, transparent 99%, gray 0);
  background-size: 10% 100%, 100% 10%;
}

.cartoon div {
  position: absolute;
  box-sizing: border-box;
}

.b {
  border: 0.5vmin solid black;
}

.hb::before,
.ha::after {
  content: "";
  display: block;
  position: absolute;
}

/****/
.cartoon {
  --label: #48d;  
}

.bottle {
  width: 30%;
  height: 86%;
  border-radius: 100% / 55% 55% 14vmin 14vmin;
  top: 13%;
  left: 50%;
  transform: translate(-50%, 0);
  box-shadow: inset 1vmin -1vmin 1vmin rgba(255,255,255,0.9), inset -1vmin -1vmin 1vmin #e7f2f6, inset 5vmin -1vmin 2vmin 4vmin #fff7, inset -5vmin -1vmin 2vmin 4vmin #3692;
  overflow: hidden;
  background: #beeeef44;
}

.bottle::before {
  width: 100%;
  height: 13%;
  border-radius: 50%;
  background: #76abd9;
  top: 25%;
  left: 50%;
  transform: translate(-50%, 0);
  border: 0.25vmin solid;
  filter: blur(1.25px);
  background: linear-gradient(-45deg, #76abd9, #a6dbff);
}

.bottle::after {
  width: 101%;
  height: 40%;
  border-radius: 0 0  100% 100% / 0 0 8.5vmin 8.5vmin;
  top: -3.5%;
  left: 50%;
  transform: translate(-50%, 0);
  box-shadow: -22.9vmin 20.5vmin, -22.7vmin 20.5vmin 2vmin 1vmin #fff8, 22.9vmin 20.5vmin, 22.95vmin 20.5vmin 4vmin 1vmin #0006, 0.1vmin 0.33vmin, -0.1vmin 0.33vmin, 0 20vmin var(--label), 0 20.4vmin;
}

.cap {
  width: 13%;
  height: 12%;
  top: 1%;
  left: 50%;
  transform: translate(-50%, 0);
  border-radius: 90% / 40%;
  box-shadow: inset 0 -6.75vmin 0 -1vmin #559cd855;
  background-color: var(--label);
  background-image: linear-gradient(to right, transparent 50%, rgba(0,0,0,0.25) 0);
  background-size: 3.33% 100%;
  overflow: hidden;
}

.cap::after {
  width: 100%;
  height: 28%;
  border-radius: 50%;
  border-bottom: 0.4vmin solid #fff4;
  background: #accff4;
}

.neck {
  width: 11%;
  height: 8%;
  top:7.75%;
  border-radius: 0 0 100% 100% / 40%;
  background: #00ff;
  left: 50%;
  transform: translate(-50%, 0);
  background: linear-gradient(to right, black 6%, #e7f2f6 0, #d5e8ef 94%, black 0);
}

.water-lines {
  width: 28%;
  top: 83%;
  height: 14%;
  background: red;
  left: 50%;
  transform: translate(-50%, 0);
  border-radius: 50%;
  background: linear-gradient(#c5e3eb, transparent);
  box-shadow: inset 0 0vmin 0.5vmin #a5c3db77;
}

/* thin border */
.thin-border .b {
  border: 0.15vmin solid rgba(0,0,0,0.5);
}

.thin-border .neck {
  background: linear-gradient(to right, rgba(0,0,0,0.5) 2%, #e7f2f6 0, #c5e3eb 98%, rgba(0,0,0,0.5) 0);
}

.thin-border .bottle::before {
  filter: blur(0.75px);
  border: 0.05vmin solid rgba(0,0,0,0.5);
}

.thin-border .bottle::after {
  box-shadow:  0.1vmin 0.125vmin rgba(0,0,0,0.20), -0.1vmin 0.125vmin rgba(0,0,0,0.20), -22.7vmin 20.5vmin 4vmin #fff8, 22.95vmin 20.5vmin 4vmin 0vmin #0004, 0 20vmin var(--label), 0.1vmin 20.125vmin rgba(0,0,0,0.25), -0.1vmin 20.125vmin rgba(0,0,0,0.25);
}

              
            
!

JS

              
                
              
            
!
999px

Console