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 class="content-box">
   <div id="ribbon-container">
      <a href="#" id="ribbon">here's your link</a>
   </div>
</div>
              
            
!

CSS

              
                      
* {
  padding: 0;
  /* Standard Reset, and we're adding box-sizing:border-box because it's awesome. */
  
  margin: 0;
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -webkit-transition: all 0s ease-in-out;
  -moz-transition: all 0s ease-in-out;
  -o-transition: all 0s ease-in-out;
  transition: all 0s ease-in-out;
}

.content-box {
  width: 100%;
  height: 400px;
  max-width:80%;
  margin: 94px auto 0 auto;
  position: relative;
  /* So we can position the banner within the box */
  
  background: gray;
  border: 5px solid white;
  box-shadow: 0 0 10px rgba(0, 0, 0, .3);
  -moz-box-shadow: 0 0 10px rgba(0, 0, 0, .3);
  -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, .3);
}

#ribbon-container {
  position: absolute;
  top: 15px;
  right: -20px;
  overflow: visible;
  /* so we can see the pseudo-elements we're going to add to the anchor */
  
  font-size: 18px;
  /* font-size and line-height must be equal so we can account for the height of the banner */
  
  line-height: 18px;
}

#ribbon-container:before {
  content: "";
  height: 0;
  width: 0;
  display: block;
  position: absolute;
  top: 3px;
  left: 0;
  border-top: 29px solid rgba(0, 0, 0, .3);
  /* These 4 border properties create the first part of our drop-shadow */
  
  border-bottom: 29px solid rgba(0, 0, 0, .3);
  border-right: 29px solid rgba(0, 0, 0, .3);
  border-left: 29px solid transparent;
}

#ribbon-container:after {
  /* This adds the second part of our dropshadow */
  
  content: "";
  height: 3px;
  background: rgba(0, 0, 0, .3);
  display: block;
  position: absolute;
  bottom: -3px;
  left: 58px;
  right: 3px;
}

#ribbon-container a {
  display: block;
  padding: 20px;
  position: relative;
  /* allows us to position our pseudo-elements properly */
  
  background: #0089d0;
  overflow: visible;
  height: 58px;
  margin-left: 29px;
  color: #fff;
  text-decoration: none;
}

#ribbon-container a:after {
  /* this creates the "folded" part of our ribbon */
  
  content: "";
  height: 0;
  width: 0;
  display: block;
  position: absolute;
  bottom: -15px;
  right: 0;
  border-top: 15px solid #004a70;
  border-right: 15px solid transparent;
}

#ribbon-container a:before {
  /* this creates the "forked" part of our ribbon */
  
  content: "";
  height: 0;
  width: 0;
  display: block;
  position: absolute;
  top: 0;
  left: -29px;
  border-top: 29px solid #0089d0;
  border-bottom: 29px solid #0089d0;
  border-right: 29px solid transparent;
  border-left: 29px solid transparent;
}

#ribbon-container a:hover {
  background: #009ff1;
}

#ribbon-container a:hover:before {
  /* this makes sure that the "forked" part of the ribbon changes color with the anchor on :hover */
  
  border-top: 29px solid #009ff1;
  border-bottom: 29px solid #009ff1;
}

              
            
!

JS

              
                
              
            
!
999px

Console