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

              
                %h1 Corner ribbons for cards
-@title = ['<p>Straight fold</p>','<p>Angled fold - more realistic</p>','<p>Straight fold on left</p>','<p>Gradient - from top to bottom. Angled fold and text shadow</p>','<p>Gradient - from centre radial. Angled fold and text shadow</p>', '<p>Gradient - from centre linear. Angled fold and text shadow</p>', '<p>Solid line on ribbon</p>', '<p>Dotted line on ribbon</p>', '<p>Full works - alt colour</p>']
.card-wrap 
	-@title.zip(1..9).each do |title, i|
		%div{:class => "card"}
			%div{:class => "set-image"}#{title}
			%div{:class => "set-headline"}
			- (1..6).each do |i|
				%div{:class => "set-text"}
			%div{:class => "ribbon-wrapper-#{i}"}
				%div{:class => "ribbon-#{i}"}Ribbon
              
            
!

CSS

              
                html {
  background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#a9aead), to(#c5cdcf));
  background: -webkit-linear-gradient(top, #c5cdcf, #a9aead);
  background: -moz-linear-gradient(top, #c5cdcf, #a9aead);
  min-height: 100%; }

h1 {
  font: bold 35px Sans-Serif;
  text-transform: uppercase;
  color: #fff;
  text-align: center;
  text-shadow: 0 0 15px rgba(0, 0, 0, 0.2); }

.card-wrap {
  text-align: center; }

.card {
  width: 400px;
  height: 500px;
  position: relative;
  background: #fff;
  overflow: visible;
  margin: 20px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
  display: inline-block; }

.set-image {
  width: 100%;
  height: 50%;
  background: #eee;
  overflow: hidden;
  font: bold 20px Sans-Serif;
  text-transform: uppercase;
  display: table; }

.set-image p {
  display: table-cell;
  vertical-align: middle;
  text-align: center;
  line-height: 25px;
  color: #d2d2d2; }

.set-headline {
  width: 65%;
  height: 10%;
  background: #eee;
  margin: 20px; }

.set-text {
  width: 90%;
  height: 12px;
  background: #eee;
  margin: 12px 20px; }

.ribbon-wrapper-1 {
  width: 106px;
  height: 108px;
  overflow: hidden;
  position: absolute;
  top: -6px;
  right: -6px; }

.ribbon-1 {
  font: bold 15px Sans-Serif;
  line-height: 18px;
  color: #333;
  text-align: center;
  text-transform: uppercase;
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  position: relative;
  padding: 7px 0;
  left: -11px;
  top: 26px;
  width: 150px;
  background-color: #6daaab;
  color: #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px; }

.ribbon-1:before, .ribbon-1:after {
  content: "";
  border-top: 4px solid #4e7c7d;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  position: absolute;
  bottom: -4px; }

.ribbon-1:before {
  left: 0; }

.ribbon-1:after {
  right: 0; }

.ribbon-wrapper-2 {
  width: 108px;
  height: 108px;
  overflow: hidden;
  position: absolute;
  top: -6px;
  right: -6px; }

.ribbon-2 {
  font: bold 15px Sans-Serif;
  line-height: 18px;
  color: #333;
  text-align: center;
  text-transform: uppercase;
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  position: relative;
  padding: 7px 0;
  left: -4px;
  top: 26px;
  width: 150px;
  background-color: #6daaab;
  color: #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
  box-shadow: -3px 5px 6px -5px rgba(0, 0, 0, 0.5); }

.ribbon-2:before, .ribbon-2:after {
  content: "";
  border-top: 4px solid #4e7c7d;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  position: absolute;
  bottom: -4px; }

.ribbon-2:before {
  content: "";
  position: absolute;
  left: 0px;
  top: 100%;
  z-index: -1;
  border-left: 4px solid #4e7c7d;
  border-right: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-top: 4px solid #4e7c7d; }

.ribbon-2:after {
  content: "";
  position: absolute;
  right: 7px;
  top: 100%;
  z-index: -1;
  border-left: 4px solid transparent;
  border-right: 4px solid #4e7c7d;
  border-bottom: 4px solid transparent;
  border-top: 4px solid #4e7c7d; }

.ribbon-wrapper-3 {
  width: 106px;
  height: 108px;
  overflow: hidden;
  position: absolute;
  top: -6px;
  left: -6px; }

.ribbon-3 {
  font: bold 15px Sans-Serif;
  line-height: 18px;
  color: #333;
  text-align: center;
  text-transform: uppercase;
  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -ms-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  position: relative;
  padding: 7px 0;
  left: -33px;
  top: 26px;
  width: 150px;
  background-color: #6daaab;
  color: #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px; }

.ribbon-3:before, .ribbon-3:after {
  content: "";
  border-top: 4px solid #4e7c7d;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  position: absolute;
  bottom: -4px; }

.ribbon-3:before {
  left: 0; }

.ribbon-3:after {
  right: 0; }

.ribbon-wrapper-4 {
  width: 108px;
  height: 108px;
  overflow: hidden;
  position: absolute;
  top: -6px;
  right: -6px; }

.ribbon-4 {
  font: bold 15px Sans-Serif;
  line-height: 18px;
  color: #333;
  text-align: center;
  text-transform: uppercase;
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  position: relative;
  padding: 7px 0;
  left: -4px;
  top: 26px;
  width: 150px;
  background-color: #6daaab;
  color: #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
  background-image: linear-gradient(#6daaab, #4e7c7d);
  box-shadow: -3px 5px 6px -5px rgba(0, 0, 0, 0.5);
  text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.4); }

.ribbon-4:before, .ribbon-4:after {
  content: "";
  border-top: 4px solid #4e7c7d;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  position: absolute;
  bottom: -4px; }

.ribbon-4:before {
  content: "";
  position: absolute;
  left: 0px;
  top: 100%;
  z-index: -1;
  border-left: 4px solid #4e7c7d;
  border-right: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-top: 4px solid #4e7c7d; }

.ribbon-4:after {
  content: "";
  position: absolute;
  right: 7px;
  top: 100%;
  z-index: -1;
  border-left: 4px solid transparent;
  border-right: 4px solid #4e7c7d;
  border-bottom: 4px solid transparent;
  border-top: 4px solid #4e7c7d; }

.ribbon-wrapper-5 {
  width: 108px;
  height: 108px;
  overflow: hidden;
  position: absolute;
  top: -6px;
  right: -6px; }

.ribbon-5 {
  font: bold 15px Sans-Serif;
  line-height: 18px;
  color: #333;
  text-align: center;
  text-transform: uppercase;
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  position: relative;
  padding: 7px 0;
  left: -4px;
  top: 26px;
  width: 150px;
  background-color: #6daaab;
  color: #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
  background-image: radial-gradient(circle farthest-side, #6daaab, #4e7c7d);
  box-shadow: -3px 5px 6px -5px rgba(0, 0, 0, 0.5);
  text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.4); }

.ribbon-5:before, .ribbon-5:after {
  content: "";
  border-top: 4px solid #4e7c7d;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  position: absolute;
  bottom: -4px; }

.ribbon-5:before {
  content: "";
  position: absolute;
  left: 0px;
  top: 100%;
  z-index: -1;
  border-left: 4px solid #4e7c7d;
  border-right: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-top: 4px solid #4e7c7d; }

.ribbon-5:after {
  content: "";
  position: absolute;
  right: 7px;
  top: 100%;
  z-index: -1;
  border-left: 4px solid transparent;
  border-right: 4px solid #4e7c7d;
  border-bottom: 4px solid transparent;
  border-top: 4px solid #4e7c7d; }

.ribbon-wrapper-6 {
  width: 108px;
  height: 108px;
  overflow: hidden;
  position: absolute;
  top: -6px;
  right: -6px; }

.ribbon-6 {
  font: bold 15px Sans-Serif;
  line-height: 18px;
  color: #333;
  text-align: center;
  text-transform: uppercase;
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  position: relative;
  padding: 7px 0;
  left: -4px;
  top: 26px;
  width: 150px;
  background-color: #6daaab;
  color: #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
  background-image: linear-gradient(#4e7c7d -50%, #6daaab 50%, #6daaab 0%, #4e7c7d 150%);
  text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.4);
  box-shadow: -3px 5px 6px -5px rgba(0, 0, 0, 0.5); }

.ribbon-6:before, .ribbon-6:after {
  content: "";
  border-top: 4px solid #4e7c7d;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  position: absolute;
  bottom: -4px; }

.ribbon-6:before {
  content: "";
  position: absolute;
  left: 0px;
  top: 100%;
  z-index: -1;
  border-left: 4px solid #4e7c7d;
  border-right: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-top: 4px solid #4e7c7d; }

.ribbon-6:after {
  content: "";
  position: absolute;
  right: 7px;
  top: 100%;
  z-index: -1;
  border-left: 4px solid transparent;
  border-right: 4px solid #4e7c7d;
  border-bottom: 4px solid transparent;
  border-top: 4px solid #4e7c7d; }

.ribbon-wrapper-7 {
  width: 108px;
  height: 108px;
  overflow: hidden;
  position: absolute;
  top: -6px;
  right: -6px; }

.ribbon-7 {
  font: bold 15px Sans-Serif;
  line-height: 18px;
  color: #333;
  text-align: center;
  text-transform: uppercase;
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  position: relative;
  padding: 7px 0;
  left: -4px;
  top: 26px;
  width: 150px;
  background-color: #6daaab;
  color: #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
  box-shadow: -3px 5px 6px -5px rgba(0, 0, 0, 0.5);
  outline: 1px solid #fff;
  outline-offset: -4px; }

.ribbon-7:before, .ribbon-7:after {
  content: "";
  border-top: 4px solid #4e7c7d;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  position: absolute;
  bottom: -4px; }

.ribbon-7:before {
  content: "";
  position: absolute;
  left: 0px;
  top: 100%;
  z-index: -1;
  border-left: 4px solid #4e7c7d;
  border-right: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-top: 4px solid #4e7c7d; }

.ribbon-7:after {
  content: "";
  position: absolute;
  right: 7px;
  top: 100%;
  z-index: -1;
  border-left: 4px solid transparent;
  border-right: 4px solid #4e7c7d;
  border-bottom: 4px solid transparent;
  border-top: 4px solid #4e7c7d; }

.ribbon-wrapper-8 {
  width: 108px;
  height: 108px;
  overflow: hidden;
  position: absolute;
  top: -6px;
  right: -6px; }

.ribbon-8 {
  font: bold 15px Sans-Serif;
  line-height: 18px;
  color: #333;
  text-align: center;
  text-transform: uppercase;
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  position: relative;
  padding: 7px 0;
  left: -4px;
  top: 26px;
  width: 150px;
  background-color: #6daaab;
  color: #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
  box-shadow: -3px 5px 6px -5px rgba(0, 0, 0, 0.5);
  outline: 1px dashed #fff;
  outline-offset: -4px; }

.ribbon-8:before, .ribbon-8:after {
  content: "";
  border-top: 4px solid #4e7c7d;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  position: absolute;
  bottom: -4px; }

.ribbon-8:before {
  content: "";
  position: absolute;
  left: 0px;
  top: 100%;
  z-index: -1;
  border-left: 4px solid #4e7c7d;
  border-right: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-top: 4px solid #4e7c7d; }

.ribbon-8:after {
  content: "";
  position: absolute;
  right: 7px;
  top: 100%;
  z-index: -1;
  border-left: 4px solid transparent;
  border-right: 4px solid #4e7c7d;
  border-bottom: 4px solid transparent;
  border-top: 4px solid #4e7c7d; }

.ribbon-wrapper-9 {
  width: 108px;
  height: 108px;
  overflow: hidden;
  position: absolute;
  top: -6px;
  right: -6px; }

.ribbon-9 {
  font: bold 15px Sans-Serif;
  line-height: 18px;
  color: #e9ea7b;
  text-align: center;
  text-transform: uppercase;
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  position: relative;
  padding: 7px 0;
  left: -4px;
  top: 26px;
  width: 150px;
  background-color: #6daaab;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
  box-shadow: -3px 5px 6px -5px rgba(0, 0, 0, 0.5);
  outline: 1px dotted #E5E82C;
  outline-offset: -4px;
  background-image: radial-gradient(circle farthest-side, #FF1C1A, #BF0B00);
  text-shadow: 2px 1px 0px rgba(0, 0, 0, 0.2); }

.ribbon-9:before, .ribbon-9:after {
  content: "";
  border-top: 4px solid #BF0B00;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  position: absolute;
  bottom: -4px; }

.ribbon-9:before {
  content: "";
  position: absolute;
  left: 0px;
  top: 100%;
  z-index: -1;
  border-left: 4px solid #BF0B00;
  border-right: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-top: 4px solid #BF0B00; }

.ribbon-9:after {
  content: "";
  position: absolute;
  right: 7px;
  top: 100%;
  z-index: -1;
  border-left: 4px solid transparent;
  border-right: 4px solid #BF0B00;
  border-bottom: 4px solid transparent;
  border-top: 4px solid #BF0B00; }

/*# sourceMappingURL=corner-ribbons.css.map */

              
            
!

JS

              
                
              
            
!
999px

Console