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

              
                <body>
    <h1>Ordered List Cards</h1>
    <ol class="ol-cards alternate" >
        <li style="--ol-cards-color-accent:#f68121">
            <div class="step"><i class="fab fa-codepen"></i></div>
            <div class="title">Step One</div>
            <div class="content">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quae culpa asperiores soluta officiis iusto quasi. Odio aliquid alias explicabo deleniti?</div>
        </li>
        <li style="--ol-cards-color-accent:#ed1c24">
            <div class="step"><i class="fab fa-github"></i></div>
            <div class="title">Step Two</div>
            <div class="content">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quae culpa asperiores soluta officiis iusto quasi. Odio aliquid alias explicabo deleniti?</div>
        </li>
        <li style="--ol-cards-color-accent:#582c8b">
            <div class="step"><i class="fab fa-html5"></i></div>
            <div class="title">Step Three</div>
            <div class="content">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quae culpa asperiores soluta officiis iusto quasi. Odio aliquid alias explicabo deleniti?</div>
        </li>
        <li style="--ol-cards-color-accent:#0166b4">
            <div class="step"><i class="fab fa-css3"></i></div>
            <div class="title">Step Four</div>
            <div class="content">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quae culpa asperiores soluta officiis iusto quasi. Odio aliquid alias explicabo deleniti?</div>
        </li>
        <li style="--ol-cards-color-accent:#00a560">
            <div class="step"><i class="fab fa-creative-commons"></i></div>
            <div class="title">Step Five</div>
            <div class="content">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quae culpa asperiores soluta officiis iusto quasi. Odio aliquid alias explicabo deleniti?</div>
        </li>
    </ol>
</body>
              
            
!

CSS

              
                @import url("https://use.fontawesome.com/releases/v5.15.3/css/all.css");
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap");

body {
  --color-bg: #f0f0f0;
  --color-text: #303030;
  background-color: var(--color-bg);
  color: var(--color-text);
  text-align: center;
  font-family: "Poppins", sans-serif;
}

.ol-cards,
.ol-cards *,
.ol-cards *::before,
.ol-cards *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
.ol-cards {
  --ol-cards-color-bg: var(--color-bg);
  list-style-type: none;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  max-width: 45em;
  padding: 2em;
  gap: 2em;
  counter-reset: ol-cards-counter;
}

.ol-cards li {
  display: grid;
  grid-template-areas:
    "step title"
    "step content";
  padding: 1em 2em 1em 0;
  row-gap: 0.5em;
  column-gap: 2em;
  box-shadow: 0.5em 0.5em 1em rgba(0, 0, 0, 0.4),
    inset 0.05em 0.05em rgba(255, 255, 255, 1);
  counter-increment: ol-cards-counter;
  text-align: left;
  background-color: var(--ol-cards-color-bg);
}

.ol-cards.alternate li:nth-child(even) {
  grid-template-areas:
    "title step"
    "content step";
  padding: 1em 0 1em 2em;
}

.ol-cards li .step {
  grid-area: step;
  display: flex;
  align-self: flex-start;
  background-color: var(--ol-cards-color-accent);
  border-radius: 0 50em 50em 0;
  padding: 1em;
  justify-content: flex-end;
  box-shadow: inset 0.25em 0.25em 0.5em rgba(0, 0, 0, 0.4),
    0em 0.05em rgba(255, 255, 255, 1);
  flex: 1;
  gap: 1em;
}

.ol-cards li .step::before {
  content: "0" counter(ol-cards-counter);
  flex: 1;
  align-self: center;
  color: var(--ol-cards-color-bg);
  font-weight: bold;
  font-size: 2em;
  text-shadow: 0.025em 0.025em 0.125em rgba(0, 0, 0, 0.4);
}
.ol-cards.alternate li:nth-child(even) .step {
  border-radius: 50em 0 0 50em;
  flex-direction: row-reverse;
}

.ol-cards li .step i {
  color: var(--ol-cards-color-accent);
  width: 2em;
  height: 2em;
  font-size: 1.8em;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background-color: var(--ol-cards-color-bg);
  box-shadow: 0.25em 0.25em 0.5em rgba(0, 0, 0, 0.4),
    inset 0.05em 0.05em rgba(255, 255, 255, 1);
}

.ol-cards li .title {
  grid-area: title;
  color: var(--ol-cards-color-accent);
  font-weight: bold;
}
.ol-cards li .content {
  grid-area: content;
  font-size: 0.9em;
}

@media only screen and (max-width: 500px) {
  .ol-cards{
    padding: 1em;
  }
  .ol-cards li{
    column-gap: 0em;
    grid-template-areas:
      'step title'
      'content content';
    grid-template-columns: min-content auto;
    padding: 1em 0em;
  }
  .ol-cards.alternate li:nth-child(even){
    column-gap: 0em;
    grid-template-areas:
      'title step'
      'content content';
    grid-template-columns: auto min-content ;
    padding: 1em 0em;
  }
  .ol-cards li .title{
    padding: 0 1em;
    align-self: center;
    width: auto;
    
  }
  .ol-cards li .step{
    font-size: .5em;
  }
  .ol-cards li .content{
    padding: 0 1em;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console