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

              
                <p class="intro">
  Testing Ribbons with cards.
</p>

<div class="card-deck">
  <div class="card">
    <div class="thumbnail-outer">
      <a href="/profile/oscar-goodman">
        <div class="thumbnail">
          <div class="thumbnail-frame">
            <div class="centered">
              <img src="https://pbs.twimg.com/profile_images/890237062342901762/iMhmJbvt_400x400.jpg" alt="Featured Content image">
            </div>
          </div>
        </div>
      </a>
      <div class="ribbon">Attorney</div>
    </div>
    <div class="card-block card-block-anchorable">
      <h3 class="card-title mb-0"><a href="/profile/oscar-goodman">Oscar Goodman</a></h3>
      <p class="card-text mb-0">Oscar Baylin Goodman is an American attorney and politician. He was the mayor of Las Vegas, Nevada from 1999 to 2011. His wife, Carolyn Goodman, succeeded him as mayor in...</p>
    </div>
  </div>
  <div class="card">
    <div class="thumbnail-outer">
    <a href="/profile/oscar-goodman">
      <div class="thumbnail">
        <div class="thumbnail-frame">
          <div class="centered">
            <img src="https://www.blackenterprise.com/wp-content/blogs.dir/1/files/2013/02/barack-obama-burger-joint-closing.jpg" alt="Featured Content image">
          </div>
        </div>
      </div>
    </a>
    <div class="ribbon">Attorney, US President</div>
    </div>
    <div class="card-block card-block-anchorable">
      <h3 class="card-title mb-0"><a href="/profile/barack-obama">Barack Obama</a></h3>
      <p class="card-text mb-0">Barack Hussein Obama II is an American attorney and politician who served as the 44th president of the United States from 2009 to 2017. A member of the Democratic Party,...</p>
    </div>
  </div>
</div>
              
            
!

CSS

              
                html {
  background: gray;
  font-family: 'Open Sans',sans-serif;
}
p.intro {
  background: white;
  font-size: 1.5em;
  padding: 1em;
}
.card-deck {
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
}
.card-deck .card {
  margin-right: 10px;
  margin-bottom: 10px;
}
.card {
  flex: 1 1 250px;
  max-width: 300px;
  background: white;
  border: 0;
  box-shadow: 2px 10px 28px -2px rgba(0, 0, 0, 0.125), 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: all 0.5s;
}
.card:hover {
  box-shadow: 2px 30px 28px -2px rgba(0, 0, 0, 0.125);
  transform: translate3d(0, -10px, 0);
}
.card a {
    position: relative;
}
.card .card-title {
  margin-top: 0;
  transition: all 250ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
  font-size: 16px;
}
.card .card-title a {
  color: black;
  text-decoration: none;
}
.card .card-title a:hover {
  color: #fc0;
}
.card .card-block {
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.075);
  border-width: 0 1px 1px 1px;
  font-size: 14px;
}
.card-block {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    padding: 1.25rem;
}
.card .card-block-anchorable {
  
}
.card .card-bottom-anchor {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 1.25rem;
}
.card .thumbnail-outer {
  position: relative;
}
.thumbnail {
    overflow: hidden;
    position: relative;
    outline: 0;
    box-sizing: content-box;
}
.thumbnail::before {
    content: "";
    display: block;
    padding-top: 100%;
}
.thumbnail .thumbnail-frame {
    overflow: hidden;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    outline: 0;
}
.thumbnail .centered {
    position: absolute;
    -webkit-transform: translate(50%,50%);
    -moz-transform: translate(50%,50%);
    -ms-transform: translate(50%,50%);
    -o-transform: translate(50%,50%);
    transform: translate(50%,50%);
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-sizing: content-box;
    outline: 0;
    display: block;
}
.thumbnail img {
    position: absolute;
    -webkit-transform: translate(-50%,-50%);
    -moz-transform: translate(-50%,-50%);
    -ms-transform: translate(-50%,-50%);
    -o-transform: translate(-50%,-50%);
    transform: translate(-50%,-50%);
    top: 0;
    left: 0;
    height: 100%;
}
.ribbon{
  position: absolute;
  padding: 0.1em 3em;
  font-size: 1em;
  font-weight: bold;
  right: 0;
  bottom: 1em;
  line-height: 1.875em;
  color: black;
  background: gold;
  box-shadow: -1px 2px 3px rgba(0,0,0,0.5);
}
.ribbon:before, .ribbon:after{
  position:absolute;
  content: '';
  display: block;
}

.ribbon:before{
  width: 0.5em;
  height: 2.05em;
  padding: 0 0 0.5em;
  top:0;
  right: -0.5em;
  background: gold;
  border-radius: 0 0 0.5em 0;
}

.ribbon:after{
  width: 0.4em;
  height: 0.4em;
  background: rgba(0,0,0,0.5);
  bottom: -0.4em;
  right: -0.4em;
  border-radius: 0 0 0.4em 0 ;
  box-shadow: inset -1px 2px 2px rgba(0,0,0,0.3);
}
              
            
!

JS

              
                
              
            
!
999px

Console