Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

Save Automatically?

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 class="garnish"></div>
  <div class="lid"></div>
  <div class="straw"></div>
  <div class="glass">

    <ul>
      <li class='ice'></li>
      <li class='ice'></li>
      <li class='ice'></li>
      <li class='ice'></li>
      <li class='ice'></li>
    </ul>
    <ul>
      <li class='bubble'></li>
      <li class='bubble'></li>
      <li class='bubble'></li>
      <li class='bubble'></li>
      <li class='bubble'></li>
      <li class='bubble'></li>
    </ul>
    <svg class="leaf-one" xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="300" height="300">
      <path fill="#0e811e" stroke="black" stroke-width="4px" d="M 150 210 C 90 170 50 50 150 50 C 250 50 210 170 150 210 L 150 170 L 200 150 L 150 170 L 100 150 L 150 170 L 150 130 L 210 100 L 150 130 L 90 100 L 150 130 L 150 90 L 190 60 L 150 90 L 110 60 L 150 90 L 150 50 L 150 210 Z" /></svg>
    <svg class="leaf-two" xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="300" height="300">
      <path fill="#0e811e" stroke="black" stroke-width="4px" d="M 150 210 C 90 170 50 50 150 50 C 250 50 210 170 150 210 L 150 170 L 200 150 L 150 170 L 100 150 L 150 170 L 150 130 L 210 100 L 150 130 L 90 100 L 150 130 L 150 90 L 190 60 L 150 90 L 110 60 L 150 90 L 150 50 L 150 210 Z" /></svg>
    <svg class="leaf-three" xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="300" height="300">
      <path fill="#0e811e" stroke="black" stroke-width="4px" d="M 150 210 C 90 170 50 50 150 50 C 250 50 210 170 150 210 L 150 170 L 200 150 L 150 170 L 100 150 L 150 170 L 150 130 L 210 100 L 150 130 L 90 100 L 150 130 L 150 90 L 190 60 L 150 90 L 110 60 L 150 90 L 150 50 L 150 210 Z" /></svg>
    <svg class="leaf-four" xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="300" height="300">
      <path fill="#0e811e" stroke="black" stroke-width="4px" d="M 150 210 C 90 170 50 50 150 50 C 250 50 210 170 150 210 L 150 170 L 200 150 L 150 170 L 100 150 L 150 170 L 150 130 L 210 100 L 150 130 L 90 100 L 150 130 L 150 90 L 190 60 L 150 90 L 110 60 L 150 90 L 150 50 L 150 210 Z" /></svg>

  </div>
              
            
!

CSS

              
                body {
  background: #e42c70;
}

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

div {
  width: 500px;
  height: 500px;
  position: absolute;
  margin: auto;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
}

.glass {
  border: 3px solid black;
  z-index: 1;
  width: 220px;
  height: 300px;
  border-top: 0px;
  border-top-right-radius: 240px 50%/50px;
  border-radius: 40px 40px 120px 50%/50px;
  overflow: hidden;
}

.glass:before {
  content: "";
  opacity: 80%;
  z-index: 99;
  position: absolute;
  bottom: 0%;
  width: 100%;
  height: 80%;
  background: #85e2ff;
  border-top: 1px solid black;
}

.lid {
  position: absolute;
  z-index: 3;
  width: 210px;
  bottom: 58%;
  height: 15px;
  border: 3px solid black;
  background: white;
  border-radius: 30px 30px 100px 50%/50px;
}

.glass ul {
  list-style: none;
  display: flex;
  height: 90px;
  position: relative;
  top: 40px;
}

.glass ul li {
  width: 50px;
  height: 50px;
}

.ice {
  border-radius: 10px;
  border: 2px solid black;
  position: absolute;
  background-color: white;
}

.ice:nth-child(1) {
  transform: translateY(30px) rotate(120deg) scale(0.5);
}

.ice:nth-child(2) {
  transform: translateX(30px) rotate(-70deg);
  z-index: 4;
}

.ice:nth-child(3) {
  transform: translate(60px, 15px) rotate(5deg) scale(1.1);
  z-index: 4;
}

.ice:nth-child(4) {
  transform: translateX(120px) rotate(-5deg);
  z-index: 1;
}

.ice:nth-child(5) {
  transform: translate(140px, 15px) rotate(10deg) scale(0.8);
  z-index: 0;
}

.bubble {
  border-radius: 50%;
  background-color: #f6f4f3;
  position: absolute;
  border: 0px;
  z-index: 99;
  opacity: 80%;
}

.bubble:nth-child(1) {
  width: 10px;
  height: 10px;
  transform: translate(100px, 50px);
}

.bubble:nth-child(2) {
  width: 20px;
  height: 20px;
  transform: translate(40px, 50px);
}

.bubble:nth-child(3) {
  width: 20px;
  height: 20px;
  transform: translate(140px, -10px);
}

.bubble:nth-child(4) {
  width: 15px;
  height: 15px;
  transform: translate(80px, 30px);
}

.bubble:nth-child(5) {
  width: 15px;
  height: 15px;
  transform: translate(10px, 20px);
}

.bubble:nth-child(6) {
  width: 15px;
  height: 15px;
  transform: translate(190px, 30px);
}

.leaf-one {
  transform: scale(0.45) translate(-40%, -50%) rotate(45deg);
  position: absolute;
}

.leaf-two {
  transform: scale(0.4) translate(-90%, -70%) rotate(-40deg);
  position: absolute;
}

.leaf-three {
  transform: scale(0.23) translate(10%, -150%) rotate(20deg);
  position: absolute;
}

.leaf-four {
  transform: scale(0.3) translate(40%, -80%) rotate(-15deg);
  position: absolute;
}

.straw {
  position: absolute;
  transform: translateY(-50px) rotate(20deg);
  height: 80%;
  width: 20px;
  background-color: #fcfc62;
  border-radius: 5px;
}

.straw:before {
  position: absolute;
  content: "";
  background-color: black;
  width: 90%;
  transform: translate(1px, 1px);
  height: 5px;
  border-radius: 50%;
}

              
            
!

JS

              
                
              
            
!
999px

Console