Lesson overview

Design a responsive card step by step

Each module adds one visual layer to the final Responsive Career Card Design.

Topic 1

What is CSS?

CSS controls presentation while HTML provides structure.

HTML content->CSS rules->Designed page

CSS as the style layer

CSS changes colour, spacing, typography, card shape, button states and layout.

.career-card {
  background: #07101d;
  color: #f7efe3;
}

Real-life example: A plain career card becomes easier to read with spacing, contrast and a clear button.

Why this matters: It helps you style the Responsive Career Card Design in a controlled way.

How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.

Key words for this subtopic
Key wordSimple meaningWhy we use itTiny example
CSS as the style layerThe main idea in this part of the lessonIt gives you one building block for the final project.career-card { background: #07101d; color: #f7efe3; }
exampleA small sample that shows the ideaIt helps you see how the concept looks in practice.career-card { background: #07101d; color: #f7efe3; }
mini-project taskA small build step after the exerciseIt turns the lesson into part of the Responsive Career Card DesignResponsive Career Card Design

Quick exercise

Name three visual things CSS can control.

Mini-project task

Write what your career card should communicate.

Rules, properties and values

A CSS rule chooses an element and applies property-value pairs.

selector {
  property: value;
}

Beginner mistake to avoid

Do not forget semicolons after declarations inside a rule.

Why this matters: It helps you style the Responsive Career Card Design in a controlled way.

How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.

Key words for this subtopic
Key wordSimple meaningWhy we use itTiny example
Rules, properties and valuesThe main idea in this part of the lessonIt gives you one building block for the final projectselector { property: value; }
exampleA small sample that shows the ideaIt helps you see how the concept looks in practiceselector { property: value; }
mini-project taskA small build step after the exerciseIt turns the lesson into part of the Responsive Career Card DesignResponsive Career Card Design

Quick exercise

Identify the property and value in color: blue;

Mini-project task

Create a class name for your career card.

Topic checkpoint

You can explain CSS as the layer that turns structure into design.

Topic 2

CSS syntax and selectors

Selectors choose what to style.

Element, class, id and descendant selectors

Use class selectors for reusable components. Use ids sparingly for unique items.

h2 {
  font-size: 2rem;
}

.career-card {
  padding: 1rem;
}

.career-card a {
  font-weight: bold;
}

Why this matters: It helps you style the Responsive Career Card Design in a controlled way.

How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.

Key words for this subtopic
Key wordSimple meaningWhy we use itTiny example
Element, class, id and descendant selectorsThe main idea in this part of the lessonIt gives you one building block for the final projecth2 { font-size: 2rem; } .career-card { padding: 1re...
exampleA small sample that shows the ideaIt helps you see how the concept looks in practiceh2 { font-size: 2rem; } .career-card { padding: 1re...
mini-project taskA small build step after the exerciseIt turns the lesson into part of the Responsive Career Card DesignResponsive Career Card Design

Quick exercise

Which selector targets every paragraph: p or .p?

Mini-project task

Style a career card title and text with class selectors.

Topic checkpoint

Your card has a reusable selector foundation.

Topic 3

Colours and backgrounds

Colour choices affect readability and mood.

Named colours, hex, rgb/rgba and gradients

Use strong contrast between text and background. Gradients can add depth when used carefully.

.career-card {
  background: linear-gradient(145deg, #07101d, #120b07);
  border: 1px solid rgba(240, 197, 141, 0.35);
  color: #f7efe3;
}

Beginner mistake to avoid

Do not put low-contrast grey text on a dark background.

Why this matters: It helps you style the Responsive Career Card Design in a controlled way.

How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.

Key words for this subtopic
Key wordSimple meaningWhy we use itTiny example
Named colours, hex, rgb/rgba and gradientsThe main idea in this part of the lessonIt gives you one building block for the final project.career-card { background: linear-gradient(145deg, ...
exampleA small sample that shows the ideaIt helps you see how the concept looks in practice.career-card { background: linear-gradient(145deg, ...
mini-project taskA small build step after the exerciseIt turns the lesson into part of the Responsive Career Card DesignResponsive Career Card Design

Quick exercise

Which is easier to read: ivory text on dark navy, or pale grey on white?

Mini-project task

Add a card background and accent colour.

Topic checkpoint

Your card has a readable visual mood.

Topic 4

Typography

Typography controls how text feels and scans.

font-family, font-size, line-height, font-weight and letter-spacing

Readable text needs enough line height and a sensible size.

.career-card h3 {
  font-size: 1.35rem;
  line-height: 1.15;
}

.career-card p {
  line-height: 1.6;
  font-weight: 600;
}

Why this matters: It helps you style the Responsive Career Card Design in a controlled way.

How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.

Key words for this subtopic
Key wordSimple meaningWhy we use itTiny example
font-family, font-size, line-height, font-weight and letter-s...The main idea in this part of the lessonIt gives you one building block for the final project.career-card h3 { font-size: 1.35rem; line-height: ...
exampleA small sample that shows the ideaIt helps you see how the concept looks in practice.career-card h3 { font-size: 1.35rem; line-height: ...
mini-project taskA small build step after the exerciseIt turns the lesson into part of the Responsive Career Card DesignResponsive Career Card Design

Quick exercise

Why can line-height make paragraphs easier to read?

Mini-project task

Improve the card title and paragraph readability.

Topic checkpoint

Your card text is easier to scan.

Topic 5

Box model

Every element has content, padding, border and margin.

Content+Padding+Border+Margin

Spacing and borders

The content is the item, padding is space inside the box, border is the box edge, and margin is space outside the box.

Padding creates space inside the card. Margin creates space outside it. Border outlines the card.

* {
  box-sizing: border-box;
}

.career-card {
  padding: 1.25rem;
  border: 1px solid rgba(240, 197, 141, 0.35);
  margin-bottom: 1rem;
}

Beginner mistake to avoid

Do not use many random margins to fix layout. Start with a clear spacing system.

Why this matters: It helps you style the Responsive Career Card Design in a controlled way.

How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.

Key words for this subtopic
Key wordSimple meaningWhy we use itTiny example
Spacing and bordersThe main idea in this part of the lessonIt gives you one building block for the final project* { box-sizing: border-box; } .career-card { paddin...
exampleA small sample that shows the ideaIt helps you see how the concept looks in practice* { box-sizing: border-box; } .career-card { paddin...
mini-project taskA small build step after the exerciseIt turns the lesson into part of the Responsive Career Card DesignResponsive Career Card Design

Quick exercise

Which property creates space inside a card?

Mini-project task

Add spacing and a border to the card.

Topic checkpoint

Your card has cleaner spacing and structure.

Topic 6

Display basics and Flexbox

Display controls how elements sit on the page.

block, inline, inline-block and none

Block elements take a full row. Inline elements sit in text flow. display: none hides an element from layout.

.tag {
  display: inline-block;
  padding: 0.35rem 0.7rem;
}

Why this matters: It helps you style the Responsive Career Card Design in a controlled way.

How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.

Key words for this subtopic
Key wordSimple meaningWhy we use itTiny example
block, inline, inline-block and noneThe main idea in this part of the lessonIt gives you one building block for the final projectdisplay: none
exampleA small sample that shows the ideaIt helps you see how the concept looks in practicedisplay: none
mini-project taskA small build step after the exerciseIt turns the lesson into part of the Responsive Career Card DesignResponsive Career Card Design

Quick exercise

Why might a tag use inline-block?

Mini-project task

Style card tags for role type and skill level.

Flexbox alignment

Flexbox helps arrange items in one row or one column. It is useful for aligning buttons, tags and small groups of content.

ItemgapItemgapItem
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

Why this matters: It helps you style the Responsive Career Card Design in a controlled way.

How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.

Key words for this subtopic
Key wordSimple meaningWhy we use itTiny example
Flexbox alignmentThe main idea in this part of the lessonIt gives you one building block for the final project.card-actions { display: flex; align-items: center;...
exampleA small sample that shows the ideaIt helps you see how the concept looks in practice.card-actions { display: flex; align-items: center;...
mini-project taskA small build step after the exerciseIt turns the lesson into part of the Responsive Career Card DesignResponsive Career Card Design

Quick exercise

Which property adds space between flex items?

Mini-project task

Align card content and buttons with Flexbox.

Topic checkpoint

Your card can align tags, text and actions neatly.

Topic 7

CSS Grid

Grid is useful for card layouts.

display grid, repeat, minmax and gap

Grid helps arrange items in rows and columns. It is useful when you want a clean group of cards that adapts to screen size.

.career-card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

Why this matters: It helps you style the Responsive Career Card Design in a controlled way.

How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.

Key words for this subtopic
Key wordSimple meaningWhy we use itTiny example
display grid, repeat, minmax and gapThe main idea in this part of the lessonIt gives you one building block for the final project.career-card-grid { display: grid; gap: 1rem; grid-...
exampleA small sample that shows the ideaIt helps you see how the concept looks in practice.career-card-grid { display: grid; gap: 1rem; grid-...
mini-project taskA small build step after the exerciseIt turns the lesson into part of the Responsive Career Card DesignResponsive Career Card Design

Quick exercise

What does gap control in a grid?

Mini-project task

Build a small card grid for several career cards.

Topic checkpoint

Your card can sit inside a responsive grid.

Topic 8

Hover, focus and responsive design

Interactive states and mobile layout make designs feel complete.

Hover, focus and transitions

Hover is for pointer users. Focus-visible helps keyboard users see where they are.

.career-card a:hover,
.career-card a:focus-visible {
  border-color: #f0c58d;
  outline: 2px solid rgba(240, 197, 141, 0.45);
}

Beginner mistake to avoid

Do not remove outlines without replacing them with a clear focus style.

Why this matters: It helps you style the Responsive Career Card Design in a controlled way.

How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.

Key words for this subtopic
Key wordSimple meaningWhy we use itTiny example
Hover, focus and transitionsThe main idea in this part of the lessonIt gives you one building block for the final project.career-card a:hover, .career-card a:focus-visible ...
exampleA small sample that shows the ideaIt helps you see how the concept looks in practice.career-card a:hover, .career-card a:focus-visible ...
mini-project taskA small build step after the exerciseIt turns the lesson into part of the Responsive Career Card DesignResponsive Career Card Design

Quick exercise

Why is focus-visible important?

Mini-project task

Add button hover and focus states.

Media queries and mobile-first thinking

Responsive design adapts layout for smaller screens. Flexible widths avoid horizontal overflow.

Desktop grid->Tablet wrap->Mobile stack
@media (max-width: 640px) {
  .career-card {
    padding: 1rem;
  }
}

Why this matters: It helps you style the Responsive Career Card Design in a controlled way.

How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.

Key words for this subtopic
Key wordSimple meaningWhy we use itTiny example
Media queries and mobile-first thinkingThe main idea in this part of the lessonIt gives you one building block for the final project@media (max-width: 640px) { .career-card { padding:...
exampleA small sample that shows the ideaIt helps you see how the concept looks in practice@media (max-width: 640px) { .career-card { padding:...
mini-project taskA small build step after the exerciseIt turns the lesson into part of the Responsive Career Card DesignResponsive Career Card Design

Quick exercise

What problem does a media query solve?

Mini-project task

Make the card responsive on mobile.

Topic checkpoint

Your card works better with pointer, keyboard and mobile users.

Topic 9

Simple animations

Small motion can make a design feel polished when used carefully.

transition, transform and keyframes

Use subtle motion for hover feedback. Avoid excessive movement and respect reduced-motion users in real projects.

.career-card {
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.career-card:hover {
  transform: translateY(-3px);
}

Beginner mistake to avoid

Do not animate layout properties like margin or top when transform can do the job more smoothly.

Why this matters: It helps you style the Responsive Career Card Design in a controlled way.

How to understand this example: Read it from top to bottom. First notice the key word, then notice the value, element or result it controls.

Key words for this subtopic
Key wordSimple meaningWhy we use itTiny example
transition, transform and keyframesThe main idea in this part of the lessonIt gives you one building block for the final project.career-card { transition: transform 220ms ease, bo...
exampleA small sample that shows the ideaIt helps you see how the concept looks in practice.career-card { transition: transform 220ms ease, bo...
mini-project taskA small build step after the exerciseIt turns the lesson into part of the Responsive Career Card DesignResponsive Career Card Design

Quick exercise

Which property is better for a small lift effect: transform or margin?

Mini-project task

Add a subtle card hover animation.

Topic checkpoint

Your card has a restrained, professional interaction.

Final mini project

Responsive Career Card Design

This project combines selectors, colours, typography, box model, spacing, borders, Flexbox, Grid, hover states, responsive design and simple animation.

<section class="career-card-grid">
  <article class="career-card">
    <span class="career-tag">Beginner path</span>
    <h3>Data Analyst</h3>
    <p>Learn Excel, SQL, Power BI, statistics and communication.</p>
    <div class="card-actions">
      <a href="#">View roadmap</a>
    </div>
  </article>
</section>
.career-card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.career-card {
  background: linear-gradient(145deg, #07101d, #120b07);
  border: 1px solid rgba(240, 197, 141, 0.35);
  border-radius: 18px;
  color: #f7efe3;
  padding: 1.25rem;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.career-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.career-card p {
  line-height: 1.6;
}

.career-tag {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: #f0c58d;
  font-weight: 700;
}

.card-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 1rem;
}

@media (max-width: 640px) {
  .career-card {
    padding: 1rem;
  }
}

Explain each CSS section

The grid controls layout, the card controls surface and spacing, text rules improve readability, and hover/focus states support interaction.

Upgrade ideas

  • Add more cards
  • Use CSS variables
  • Create a dark/light theme
  • Add badges
  • Connect cards to learning pages

Next step

Add interaction with JavaScript

After styling cards with CSS, JavaScript can filter, expand or update them.