CSS Course Card

An online course card with a cover tile, level tag, lesson count and a styled progress bar.

  • course
  • lesson
  • elearning
  • progress
  • education
  • lms
HTML
<article class="course-card">
  <div class="course-card-cover" aria-hidden="true">CSS</div>
  <div class="course-card-body">
    <span class="course-card-level">Intermediate</span>
    <h3><a href="#">Modern CSS Layouts</a></h3>
    <p>12 lessons · 3 h 20 min</p>
    <label>
      <span>40% complete</span>
      <progress value="40" max="100">40%</progress>
    </label>
  </div>
</article>
CSS
.course-card {
  display: flex;
  width: 100%;
  max-width: 320px;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px -10px rgba(30, 64, 175, 0.3);
  color: #172554;
  font-family: system-ui, sans-serif;
}

.course-card-cover {
  display: grid;
  flex: none;
  place-items: center;
  width: 88px;
  background: linear-gradient(160deg, #60a5fa, #1d4ed8);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.course-card-body {
  flex: 1;
  padding: 14px;
}

.course-card-level {
  padding: 2px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}

.course-card h3 {
  margin: 8px 0 2px;
  font-size: 15px;
}

.course-card h3 a {
  color: inherit;
  text-decoration: none;
}

.course-card h3 a:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.course-card p {
  margin: 0 0 10px;
  color: #64748b;
  font-size: 12px;
}

.course-card label {
  display: grid;
  gap: 4px;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
}

.course-card progress {
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: #e2e8f0;
  -webkit-appearance: none;
  appearance: none;
}

.course-card progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #e2e8f0;
}

.course-card progress::-webkit-progress-value {
  border-radius: 999px;
  background: #2563eb;
}

.course-card progress::-moz-progress-bar {
  border-radius: 999px;
  background: #2563eb;
}

About this CSS Course Card

This CSS Course Card is 90 lines of pure CSS (1.5 KB) with no JavaScript and no dependencies. It uses linear gradients, box shadows, CSS Grid and Flexbox. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.

CSS features used

Customize it

The colors in this snippet. Search and replace them to match your brand:

  • #fff
  • #172554
  • #60a5fa
  • #1d4ed8
  • #dbeafe
  • #2563eb
  • #64748b
  • #475569
  • #e2e8f0

How to use this course card

  1. Copy the HTML and paste it where you want the element to appear.
  2. Copy the CSS into your stylesheet, or inside a <style> tag.
  3. Keep the .course-card class name, or rename it in both places. Then tweak colors, sizes and timing to match your design.
  4. Using React or Next.js? Change class to className in the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).

Building with an AI tool?

“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.

Feedback