Pen Settings



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


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


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.


<article class="card card-grid">
  <div class="card-text">
    Hi, I’m Grace Hopper and I’m a computer scientist and systems designer.
  <div class="card-image">
    <img alt="Black and white photo of Grace Hopper" src="" width="600" height="400">
  <div class="card-cta">
    <a href="/">Contact</a>


                /*/ resets /*/

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font: 100%/1.15 sans-serif;

/* root */

/* flexible/fluid images */

img {
  width: auto;
  max-width: 100%;
  height: auto;
  vertical-align: middle;

/* --- card --- */

.card {
  display: block;
  max-width: 24rem;
  background-color: hsl(210,40%,45%);
  padding: 1.5rem;
  border-radius: .5rem;
  border: 0.3rem solid hsl(220,45%,25%);
  margin: 6em auto;

/* text */

.card-text {
  float: left;
  width: 50%;

/* vertically align text */

.card-text p {
  display: inline-block;
  font-size: 1.15em;
  line-height: 1.5;
  color: #fff;
  vertical-align: middle;

/* image */

.card-image {
  float: right;
  width: 7em;
  height: 7em;
  vertical-align: middle;
  border: 1rem solid hsl(220,45%,25%);
  border-radius: 50%;
  overflow: hidden;

.card-image img {
  display: block;
  position: relative;
  left: -20%;
  max-width: none;
  max-height: 100%;

/* cta */

.card-cta {
  height: 0;
  padding-top: 2rem;
  clear: both;

.card-cta a {
  position: relative;
  display: block;
  max-width: 12rem;
  color: #fff;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  background-color: hsl(220,45%,25%);
  padding: 1rem 1.5rem;
  border-radius: .5rem;
  margin: 0 auto;

/* modern layout */

@supports (display: grid) {

  .card-grid {
    display: grid;
    grid-gap: 0 15%;
    align-items: center;
      "card-text  card-image"
      "card-cta   card-cta";

  .card-grid .card-text {
    grid-area: card-text;
    width: auto;

  .card-grid .card-image {
    grid-area: card-image;

  .card-grid .card-cta {
    grid-area: card-cta;