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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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 Ada Lovelace and I’m a computer programmer and systems designer.
  <div class="card-image">
    <img alt="Illustrative color portrait of Ada Lovelace" 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;
/* reset */

/* flexible/fluid images */

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

/* --- card --- */

.card {
  display: block;
  max-width: 24rem;
  background-color: #707070;
  padding: 1.5rem;
  border-radius: .5rem;
  margin: 0 auto 1.5rem;

/* 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 #b8b8b8;
  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: #343434;
  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;