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

              
                <div class="card chearts c1 cardside"><span>&#x1f0b8;</span></div><!--
--><div class="card cspades c8 cardside"><span>&#x1f0ae;</span></div><!--
--><div class="card cdiamonds c10 cardside"><span>&#x1f0ae;</span></div><!--
--><div class="card cclubs c13 cardside"><span>&#x1f0ae;</span></div><!--
--><div class="card cdiamonds c12"><span>&#x1f0cd;</span></div>
<!--
  To use, make a div with class "card" to create the actual card.
  Use "chearts" "cdiamonds" "cspades" and "cclubs" as a class to choose the suite
  Use "c1" - "c13" to choose the rank
  Use "cback" to show the back of a card
  Add "cardside" to collapse the card into a small corner
  The span inside is optional, but recommended, as without it, the small cards don't
    line up with the rounded corners of the next card over. I usually put a fallback
    html unicode for each card inside the span, in case the CSS doesn't work somehow
  For best results, leave no spaces between each div
-->
              
            
!

CSS

              
                body{
  background:#212121;
  padding:0;margin:0;
}



.card{
  display:inline-block;
  width:250px;
  height:350px;
  border-radius:10px;
  position:relative;
  overflow:hidden;
  color:white;
  border-style:solid;
  border-width:2px;
  border-color:#cccccc;
  padding:0;margin:0;
  box-shadow: -2px 0px 10px black;
}
.card span{
  display:none;
}
.card::before{
  font-size:300px;
  font-family:"Helvetica", sans-serif;
  font-weight:bold;
  margin:0;padding:0;
  top:50px;
  position:absolute;
  line-height:250px;
  left:-30px;
}
.card::after{
  font-size:150px;
  line-height:150px;
  top:80px;
  position:absolute;
  right:25px;
}
  
  
.cardside{
  width:50px;
  border-top-right-radius:0;
  border-bottom-right-radius:0;
  border-right:none;
  overflow:visible;
}
.cardside span{
  position:absolute;
  display:inline-block;
  top:-2px;left:30px;height:100%;width:50px;
  background:#050505;
  z-index:-1;
  border-top:2px #cccccc solid;
  border-bottom:2px #cccccc solid;
  font-size:0;
}
.cardside::before{
  font-size:90px;
  top:0;
  left:0;
  width:50px;
  text-align:center;
  line-height:90px;
}
.cardside::after{
  font-size:90px;
  line-height:90px;
  top:70px;
  position:absolute;
  right:initial;
  width:50px;
  text-align:center;
}


.cback{
  background:#616161;
}
.cardside.cback span{background:#616161;}

.cspades, .cclubs{background:#050505;}
.chearts, .cdiamonds{background:#B71C1C;}
.cardside.chearts span, .cardside.cdiamonds span{background:#B71C1C;}
.cspades::after{content:'♠';}
.cclubs::after{content:'♣';right:17px;} .cardside.cclubs::after{right:5px;}
.chearts::after{content:'♥';} .cardside.chearts::after{right:2px;}
.cdiamonds::after{content:'♦';}

.c1::before{content:'A';left:-40px;} .cardside.c1::before{left:-10px;width:70px;}
.c2::before{content:'2';}
.c3::before{content:'3';}
.c4::before{content:'4';}
.c5::before{content:'5';}
.c6::before{content:'6';}
.c7::before{content:'7';}
.c8::before{content:'8';}
.c9::before{content:'9';}
.c10::before{
  content:'10';
  left:-35px;
  letter-spacing:-40px;
  font-size:200px;
} .cardside.c10::before{font-size:90px; letter-spacing:-15px; left:-15px;clip-path: polygon(30% 0%, 30% 100%, 200% 100%, 200% 0%);}
.c11::before{content:'J';}
.c12::before{content:'Q';left:-90px;} .cardside.c12::before{left:-15px;}
.c13::before{content:'K';left:-35px} .cardside.c13::before{left:-7px;}
              
            
!

JS

              
                
              
            
!
999px

Console