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 Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

              
                <div class="flag bahamas"></div>
<div class="flag norway"></div>
<div class="flag cameroon"></div>
<div class="flag france"></div>
<div class="flag england"></div>
<div class="flag french-navy"></div>
<div class="flag switzerland"></div>
<div class="flag germany"></div>
<div class="flag japan"></div>

              
            
!

CSS

              
                * {
  box-sizing: border-box;
}

/* Repeated utility stuff. */
body {
  background: #3d3d3d;
}
.flag {
  display: inline-block;
  position: relative;
  box-sizing: border-box;
  margin: 20px 20px;
}

/*
Flag of England (Cross of St. George):

http://www.crwflags.com/fotw/flags/gb-eng.html#fly
https://en.wikipedia.org/wiki/Flag_of_England
*/
.england {
  position: relative;
  display: inline-block;
  background: #ce1124;
  width: 250px;
  height: 150px;
}
.england:before {
  position: absolute;
  left: 0;
  top: 0;
  content: '';
  background: white;
  width: 110px;
  height: 60px;
  box-shadow: 
    0px 90px white,
    140px 0 white,
    140px 90px white;
}

/* Flag of France (Tricolore) and Flag of France (French Navy):
https://en.wikipedia.org/wiki/Flag_of_France
*/
.france {
  position: relative;
  display: inline-block;
  width: 270px;
  height: 180px;
  background: white;
}
.france:before {
  position: absolute;
  background: #0055A4;
  width: 90px;
  height: 180px;
  content: '';
}
.france:after {
  position: absolute;
  background: #EF4135;
  width: 90px;
  height: 180px;
  top: 0;
  right: 0;
  content: '';
}
.french-navy {
  position: relative;
  display: inline-block;
  width: 270px;
  height: 180px;
  background: white;
}
.french-navy:before {
  position: absolute;
  background: #0055A4;
  width: 81px;
  height: 180px;
  content: '';
}
.french-navy:after {
  position: absolute;
  background: #EF4135;
  width: 99.9px;
  height: 180px;
  top: 0;
  right: 0;
  content: '';
}

/*
Flag of Switzerland:
http://www.crwflags.com/fotw/flags/ch.html
*/
.switzerland {
  background: white;
  width: 110px;
  height: 110px;
  border: 15px solid red;
}
.switzerland:before {
  background: red;
  content: '';
  height: 28px;
  width: 28px;
  position: absolute;
  top: 0;
  left: 0;
  box-shadow:
    0px 52px red,
    52px 52px red,
    52px 0 red;
}

/*
Flag of the Bahamas:
https://en.wikipedia.org/wiki/Flag_of_the_Bahamas
*/
.bahamas {
  background: #ffc72c;
  width: 300px;
  height: 150px;
  border-top: 50px solid #00778b;
  border-bottom: 50px solid #00778b;
}
.bahamas:before {
  box-sizing: content-box;
  position: absolute;
  content: '';
  width: 0;
  height: 0;
  top: -50px;
  left: 0;
  border-top: 75px solid transparent;
  border-bottom: 75px solid transparent;
  border-left: 129.9px solid black;
}

/*
Flag of Germany:
https://en.wikipedia.org/wiki/Flag_of_Germany
*/
.germany {
  width: 270px;
  height: 180px;
  background: #dd0000;
  border-top: 60px solid black;
  border-bottom: 60px solid #ffce00;
}

/*
Flag of Japan:
https://en.wikipedia.org/wiki/Flag_of_Japan
(2008 Summer Olympics Protocol Guide – Flag Manual: conversion from Pantone 032 coated)
*/
.japan {
  background: white;
  width: 300px;
  height: 200px;
}
.japan:before {
  position: absolute;
  content: '';
  top: 40px;
  left: 90px;
  border-radius: 50%;
  background: red;
  width: 120px;
  height: 120px;
}

/*
Flag of Norway:
https://en.wikipedia.org/wiki/Flag_of_Norway
*/
.norway {
  width: 270px;
  height: 160px;
  background: #ED2939;
}
.norway:before {
  box-sizing: border-box;
  content: '';
  position: absolute;
  top: 60px;
  width: 270px;
  height: 40px;
  border-top: 10px solid white;
  border-bottom: 10px solid white;
  background: #002664;
}
.norway:after {
  position: absolute;
  top: 0px;
  left: 60px;
  content: '';
  width: 10px;
  height: 60px;
  background: white;
  box-shadow:
    10px 0px #002664,
    20px 0px #002664,
    30px 0px white,
    
    10px 40px #002664,
    20px 40px #002664,
    
    0px 100px white,
    10px 100px #002664,
    20px 100px #002664,
    30px 100px white;
}


/**
Flag of Cameroon:
https://flagspot.net/flags/cm.html
*/
.cameroon {
  box-sizing: border-box;
  background: #ce1126;
  width: 300px;
  height: 200px;
  border-left: 100px solid #007a5e;
  border-right: 100px solid #fcd116;
}
.cameroon:after {
  content: '★';
  position: absolute;
  line-height: 28px;
  top: 85px;
  left: 30px;
  text-align: center;
  font-size: 40px;
  color: #fcd116;
}
              
            
!

JS

              
                
              
            
!
999px

Console