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 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

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 class="structure">
  <div class="badge-one-border">
    <div class="badge-one-content">
      <h2>100%</h2>
      <h3>Premium <span>Quality</span></h3>
    </div>
  </div>
</div>
<div class="structure">
  <div class="badge-two">
    <h2>100%</h2>
    <h3>Premium <span>Quality</span></h3>
  </div>
</div>
<div class="structure">
  <div class="badge-three">
    <h2>100%</h2>
    <h3>Premium <span>Quality</span></h3>
  </div>
</div>
              
            
!

CSS

              
                /* @TODO: Actual comments. */
/* Also: reorder and cleanup things. */
/* Consistent markup, just change class call for different styles. */
/* And.... better resizing via variables. */
/* Probably other things too. */
/* So messy, sigh. */

@import url(https://fonts.googleapis.com/css?family=Bitter:700|Droid+Serif:400|400italic);

@teal: #478266;
@brown: #665136;
@pink: #d56945;
@body: #e9d2a3;
@badge-side: 150px;
@badge-one-side: @badge-side;

body {
  padding: 5em;
  background-color: @body;
}

h1,h2,h3,h4 {
  font-family: 'Bitter',serif;
  font-weight: 700;
}

.structure {
  width: @badge-side + 100;
  float: left;
}

.badge-three {
  position: relative;
  z-index: 1;
  width: @badge-side * 2;
  height: @badge-side;
  text-align: center;
  &:before,
  &:after {
    position: absolute;
    z-index: -1;
    content: '';
    display: block;
    width: 0;
    height: 0;
  }
  &:before {
    top: @badge-side/2;
    left: 0;
    border-top: @badge-side/2 solid @pink;
    border-left: @badge-side solid transparent;
    border-right: @badge-side solid transparent;
  }
  &:after {
    top: 0;
    left: 0;
    border-bottom: @badge-side/2 solid @pink;
    border-left: @badge-side solid transparent;
    border-right: @badge-side solid transparent;
  }
}

.badge-two {
  position: relative;
  width: @badge-side;
  height: @badge-side;
  border: 2px dashed @teal;
  border-radius: @badge-side;
}
.badge-two:after {
  position: absolute;
  top: -8px;
  left: -8px;
  display: block;
  width: @badge-side + 8;
  height: @badge-side + 8;
  content: '';
  border: 4px solid @brown;
  border-radius: @badge-side + 8;
}
.badge-two:before {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: -1;
  display: block;
  width: @badge-side - 8;
  height: @badge-side - 8;
  content: '';
  background-color: @pink;
  border-radius: @badge-side;
}
.badge-two h2 {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -0.63em;
  margin-left: -1.30em;
  font-family: 'Droid Serif';
  font-size: 2.7em;
  font-weight: 400;
  text-shadow: 1px 1px 0 @body;
  color: @teal;
  -webkit-transform: rotate(-30deg);
      -ms-transform: rotate(-30deg);
          transform: rotate(-30deg);
}
.badge-two h3 {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 7;
  width: @badge-side * .8;
  margin-top: 1.2em;
  font-size: 1.5em;
  text-align: center;
  text-shadow: 1px 1px 0 @body;
  color: @brown;
  -webkit-transform: rotate(-30deg);
      -ms-transform: rotate(-30deg);
          transform: rotate(-30deg);
}
.badge-two h3 span {
  position: absolute;
  top: 2.5em;
  right: 0;
  left: 0;
  display: inline-block;
  
}

.badge-one-content {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: @badge-one-side;
  height: @badge-one-side;
  margin-left: -((@badge-one-side/2)+5);
  margin-top: -((@badge-one-side/2)+5);
  background-color: @brown;
  border: 5px solid @body;
  border-radius: @badge-one-side;
}

.badge-one-content h2 {
  position: absolute;
  top: 15px;
  left: 50%;
  z-index: 3;
  width: @badge-one-side;
  margin-top: 0;
  margin-left: -(@badge-one-side/2);
  padding: 0;
  font-family: 'Droid Serif',serif;
  font-weight: 400;
  font-style: italic;
  font-size: 2em;
  color: @brown;
}

.badge-one-content h3 {
  box-sizing: border-box;
  position: absolute;
  top: 5px;
  left: 5px;
  width: (@badge-one-side - 10);
  height: (@badge-one-side/2);
  margin: 0;
  padding-top: 40px;
  font-size: 1.65em;
  letter-spacing: 0.05em;
  color: @pink;
  background-color: @body;
  border-radius: @badge-one-side @badge-one-side 0 0;
}
.badge-one-content h3 span {
  color: @body;
}

.badge-one-border-shared() {
  width: @badge-one-side;
  height: @badge-one-side;
  background-color: @teal;
  border-radius: 9px;
}

.badge-one-border {
  .badge-one-border-shared();
  position: relative;
  text-align: center;
}

.badge-one-border:before,
.badge-one-border:after {
  .badge-one-border-shared();
  z-index: -1;
  content: "";
  position: absolute;
  top: 0;
  left: 0;
}

.badge-one-border:before {
  -webkit-transform: rotate(30deg);
     -moz-transform: rotate(30deg);
      -ms-transform: rotate(30deg);
       -o-transform: rotate(30deg);
}

.badge-one-border:after {
  -webkit-transform: rotate(60deg);
     -moz-transform: rotate(60deg);
      -ms-transform: rotate(60deg);
       -o-transform: rotate(60deg);
}

              
            
!

JS

              
                
              
            
!
999px

Console