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="container">
  <!-- Japanese Boat -->
  <div class="boat">
    <div class="roof"></div>
    <div class="cabin">
      <div class="cabin-window"></div>
    </div>
    <div class="door-window"></div>
    <div class="posts"></div>
    <div class="lanterns">
      <div class="lantern-1"></div>
      <div class="lantern-2"></div>
      <div class="lantern-3"></div>
      <div class="lantern-4"></div>
      <div class="lantern-5"></div>
      <div class="lantern-6"></div>
      <div class="lantern-7"></div>
      <div class="lantern-8"></div>
      <div class="lantern-9"></div>
      <div class="lantern-10"></div>
      <div class="lantern-11"></div>
      <div class="lantern-12"></div>
    </div>
    <div class="rail-pole"></div>
    <div class="rail-1"></div>
    <div class="rail-2"></div>
    <div class="side-wall"></div>
    <div class="deck"></div>
    <div class="hull"></div>
    <div class="keel"></div>
    <div class="bow"></div>
    <div class="bow-tip"></div>
  </div>
</div>
              
            
!

CSS

              
                /* Japanese Boat */

/* Roof */
.roof {
  position: absolute;
  width: 380px;
  height: 3px;
  left: 23px;
  top: 216px;
  background: #af7c52;
}

.roof::after {
  content: "";
  position: absolute;
  width: 380px;
  height: 16px;
  left: 0px;
  top: -16px;
  background: repeating-linear-gradient(
      to right,
      transparent,
      transparent 45px,
      #3eb26d 45px,
      #3eb26d 45.5px,
      transparent 45.5px,
      transparent 57px
    ),
    linear-gradient(#3fa060, #338950);
  clip-path: polygon(4.5% 0%, 95.5% 0%, 100% 100%, 0% 100%);
}

/* Cabin */
.cabin {
  position: absolute;
  width: 330px;
  height: 40px;
  left: 48px;
  top: 219px;
  background: #9a6440;
}
.cabin::before {
  content: "";
  position: absolute;
  width: 61px;
  height: 33px;
  left: 0px;
  top: 7px;
  background: #d4b69b;
}

/* Cabin Window */
.cabin-window {
  position: absolute;
  width: 265px;
  height: 30px;
  left: 61px;
  top: 7px;
  border: 1px solid #d9c0a2;
  background: repeating-linear-gradient(
      to right,
      transparent,
      transparent 13px,
      #d4bba0 13px,
      #d4bba0 14px
    ),
    linear-gradient(to right, #7899cc, #607fab);
}
.cabin-window::before {
  content: "";
  position: absolute;
  width: 265px;
  height: 16px;
  left: 0px;
  top: 0px;
  background: repeating-linear-gradient(
      to right,
      transparent,
      transparent 6px,
      #d4bba0 6px,
      #d4bba0 7px
    ),
    repeating-linear-gradient(
      to bottom,
      #f7faf8,
      #f7faf8 3px,
      transparent 3px,
      transparent 4px
    ),
    linear-gradient(#d4bba0, #d4bba0);
}

/* Posts */
.posts {
  position: absolute;
  width: 330.5px;
  height: 39px;
  left: 48px;
  top: 219px;
  background: linear-gradient(
    to right,
    #8d5429,
    #8d5429 2px,
    transparent 2px,
    transparent 30px,
    #8d5429 30px,
    #8d5429 32px,
    transparent 32px,
    transparent 60px,
    #8d5429 60px,
    #8d5429 62px,
    transparent 62px,
    transparent 89.5px,
    #814a20 89.5px,
    #814a20 91.5px,
    transparent 91.5px,
    transparent 119px,
    #814a20 119px,
    #814a20 121px,
    transparent 121px,
    transparent 149px,
    #814a20 149px,
    #814a20 151px,
    transparent 151px,
    transparent 179px,
    #814a20 179px,
    #814a20 181px,
    transparent 181px,
    transparent 209px,
    #814a20 209px,
    #814a20 211px,
    transparent 211px,
    transparent 239px,
    #814a20 239px,
    #814a20 241px,
    transparent 241px,
    transparent 268px,
    #814a20 268px,
    #814a20 270px,
    transparent 270px,
    transparent 298px,
    #814a20 298px,
    #814a20 300px,
    transparent 300px,
    transparent 328px,
    #814a20 328px,
    #814a20 330px,
    transparent 330px
  );
}

/* Lanterns */
/* Lantern 1 */
.lantern-1 {
  position: absolute;
  width: 12px;
  height: 13.5px;
  left: 43px;
  top: 220.5px;
  background: repeating-linear-gradient(
    #eaedeb,
    #eaedeb 1.5px,
    #f7faf8 1.5px,
    #f7faf8 2px
  );
  border-radius: 50%;
}
.lantern-1::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: -0.8px;
  background: #161a20;
}
.lantern-1::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: 13px;
  background: #161a20;
}

/* Lantern 2 */
.lantern-2 {
  position: absolute;
  width: 12px;
  height: 13.5px;
  left: 73px;
  top: 220.5px;
  background: repeating-linear-gradient(
    #d7000a,
    #d7000a 1.5px,
    #f62a2c 1.5px,
    #f62a2c 2px
  );
  border-radius: 50%;
}
.lantern-2::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: -0.8px;
  background: black;
}
.lantern-2::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: 13px;
  background: black;
}

/* Lantern 3 */
.lantern-3 {
  position: absolute;
  width: 12px;
  height: 13.5px;
  left: 103px;
  top: 220.5px;
  background: repeating-linear-gradient(
    #eaedeb,
    #eaedeb 1.5px,
    #f7faf8 1.5px,
    #f7faf8 2px
  );
  border-radius: 50%;
}
.lantern-3::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: -0.8px;
  background: black;
}
.lantern-3::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: 13px;
  background: black;
}

/* Lantern 4 */
.lantern-4 {
  position: absolute;
  width: 12px;
  height: 13.5px;
  left: 132.5px;
  top: 220.5px;
  background: repeating-linear-gradient(
    #d7000a,
    #d7000a 1.5px,
    #f62a2c 1.5px,
    #f62a2c 2px
  );
  border-radius: 50%;
}
.lantern-4::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: -0.8px;
  background: black;
}
.lantern-4::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: 13px;
  background: black;
}

/* Lantern 5 */
.lantern-5 {
  position: absolute;
  width: 12px;
  height: 13.5px;
  left: 162px;
  top: 220.5px;
  background: repeating-linear-gradient(
    #eaedeb,
    #eaedeb 1.5px,
    #f7faf8 1.5px,
    #f7faf8 2px
  );
  border-radius: 50%;
}
.lantern-5::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: -0.8px;
  background: black;
}
.lantern-5::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: 13px;
  background: black;
}

/* Lantern 6 */
.lantern-6 {
  position: absolute;
  width: 12px;
  height: 13.5px;
  left: 192px;
  top: 220.5px;
  background: repeating-linear-gradient(
    #d7000a,
    #d7000a 1.5px,
    #f62a2c 1.5px,
    #f62a2c 2px
  );
  border-radius: 50%;
}
.lantern-6::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: -0.8px;
  background: black;
}
.lantern-6::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: 13px;
  background: black;
}

/* Lantern 7 */
.lantern-7 {
  position: absolute;
  width: 12px;
  height: 13.5px;
  left: 222px;
  top: 220.5px;
  background: repeating-linear-gradient(
    #eaedeb,
    #eaedeb 1.5px,
    #f7faf8 1.5px,
    #f7faf8 2px
  );
  border-radius: 50%;
}
.lantern-7::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: -0.8px;
  background: black;
}
.lantern-7::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: 13px;
  background: black;
}

/* Lantern 8 */
.lantern-8 {
  position: absolute;
  width: 12px;
  height: 13.5px;
  left: 252px;
  top: 220.5px;
  background: repeating-linear-gradient(
    #d7000a,
    #d7000a 1.5px,
    #f62a2c 1.5px,
    #f62a2c 2px
  );
  border-radius: 50%;
}
.lantern-8::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: -0.8px;
  background: black;
}
.lantern-8::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: 13px;
  background: black;
}

/* Lantern 9 */
.lantern-9 {
  position: absolute;
  width: 12px;
  height: 13.5px;
  left: 282px;
  top: 220.5px;
  background: repeating-linear-gradient(
    #eaedeb,
    #eaedeb 1.5px,
    #f7faf8 1.5px,
    #f7faf8 2px
  );
  border-radius: 50%;
}
.lantern-9::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: -0.8px;
  background: black;
}
.lantern-9::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: 13px;
  background: black;
}

/* Lantern 10 */
.lantern-10 {
  position: absolute;
  width: 12px;
  height: 13.5px;
  left: 311px;
  top: 220.5px;
  background: repeating-linear-gradient(
    #d7000a,
    #d7000a 1.5px,
    #f62a2c 1.5px,
    #f62a2c 2px
  );
  border-radius: 50%;
}
.lantern-10::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: -0.8px;
  background: black;
}
.lantern-10::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: 13px;
  background: black;
}

/* Lantern 11 */
.lantern-11 {
  position: absolute;
  width: 12px;
  height: 13.5px;
  left: 341px;
  top: 220.5px;
  background: repeating-linear-gradient(
    #eaedeb,
    #eaedeb 1.5px,
    #f7faf8 1.5px,
    #f7faf8 2px
  );
  border-radius: 50%;
}
.lantern-11::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: -0.8px;
  background: black;
}
.lantern-11::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: 13px;
  background: black;
}

/* Lantern 12 */
.lantern-12 {
  position: absolute;
  width: 12px;
  height: 13.5px;
  left: 371px;
  top: 220.5px;
  background: repeating-linear-gradient(
    #d7000a,
    #d7000a 1.5px,
    #f62a2c 1.5px,
    #f62a2c 2px
  );
  border-radius: 50%;
}
.lantern-12::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: -0.8px;
  background: black;
}
.lantern-12::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  left: 3.5px;
  top: 13px;
  background: black;
}

/* Door / Window */
.door-window {
  position: absolute;
  width: 11.5px;
  height: 27px;
  left: 86.5px;
  top: 228px;
  background: #62779e;
  border: 1.5px solid #9e603c;
}

.door-window::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  left: -33px;
  top: 3px;
  background: #62779e;
  border: 1.5px solid #9e603c;
}

.door-window::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  left: -23px;
  top: 3px;
  background: #62779e;
  border: 1.5px solid #9e603c;
}

/* Rail */
.rail-pole {
  position: absolute;
  width: 323px;
  height: 32px;
  left: 95px;
  top: 227px;
  background: repeating-linear-gradient(
    to right,
    transparent,
    transparent 14px,
    #9b6b31 14px,
    #9b6b31 16px,
    transparent 16px
  );
  clip-path: path("M 0,14 C 94,21 260,10 323,0 L 323,13 C 290,28 94,34 0,29 Z");
}

.rail-1 {
  position: absolute;
  width: 411px;
  height: 33px;
  left: 12px;
  top: 222px;
  background: #bb835e;
  clip-path: path(
    "M 2,12 C 94,23 290,24 406,2.5 L 406,6 C 290,26 94,27 2,14.5 Z"
  );
}

.rail-2 {
  position: absolute;
  width: 411px;
  height: 25px;
  left: 12px;
  top: 231px;
  background: #bb835e;
  clip-path: path(
    "M 82,17.5 C 120,20 280,24 406,2 L 406,6 C 290,26 82,24 82,20 Z"
  );
}

/* Side Wall */
.side-wall {
  position: absolute;
  width: 80.5px;
  height: 21px;
  left: 15px;
  top: 236px;
  background: #e7d3bf;
  clip-path: polygon(0% 0%, 100% 26%, 100% 100%, 0% 100%);
}

/* Deck */
.deck {
  position: absolute;
  width: 437px;
  height: 41px;
  left: 15px;
  top: 228px;
  background: #ad7a58;
  clip-path: path("M 0,22 C 90,33 356,36 436,2 L 418,20 C 305,47 90,42 0,33");
}
.deck::before {
  content: "";
  position: absolute;
  width: 437px;
  height: 41px;
  left: 0px;
  top: -1px;
  background: repeating-linear-gradient(
    to right,
    transparent,
    transparent 2px,
    #e9e9e9 2px,
    #e9e9e9 12px,
    transparent 10px,
    transparent 18px
  );
  clip-path: path(
    "M 0,26 C 105,38 369,36 436,6.5 L 420,17.5 C 330,42 90,43 0,31"
  );
}

/* Hull */
.hull {
  position: absolute;
  width: 420px;
  height: 46px;
  left: 15px;
  top: 247px;
  background: #e6d3bf;
  clip-path: path(
    "M 0,13.5 C 90,23 295,27 420,0 L 400,40 L 29.5,50 L 29.5,26 L 0,21 Z"
  );
}

/* Keel */
.keel {
  position: absolute;
  width: 358px;
  height: 18px;
  left: 44.5px;
  top: 277px;
  background: #cdad92;
  clip-path: path("M 0,10 C 70,15 250,20 358,0 L 358, 20 L 0,20 Z");
}

/* Bow */
.bow {
  position: absolute;
  width: 108px;
  height: 83px;
  left: 376px;
  top: 212px;
  background: #e1c5ae;
  clip-path: polygon(87% 0, 96% 22%, 31% 102%, 1% 100%);
}

.bow-tip {
  position: absolute;
  width: 24px;
  height: 34px;
  left: 466px;
  top: 198px;
  background: #338950;
  clip-path: polygon(70% 5%, 91% 27%, 57% 95%, 14% 43%);
}

/* Body and Container Settings */
/* Center shapes */
body {
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* Set background and border color */
.container {
  min-width: 500px;
  height: 500px;
  border: 5px solid lightgray;
  background: transparent;
  position: relative;
  margin: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

              
            
!

JS

              
                
              
            
!
999px

Console