HTML Academy
Previous task
Introduction to CSS Custom Properties1/5
Back to the list of challenges
  • 1. Custom Properties, Mastery Challenge 1
  • 2. Custom Properties, Mastery Challenge 2
  • 3. Custom Properties, Mastery Challenge 3
  • 4. Custom Properties, Mastery Challenge 4
  • 5. Custom Properties, Mastery Challenge 5
  • Sign up
  • Log in

Register to take up challenges

Registration will only take a minute and let you save your study progress. You can register with your email and password or login via social networks.

or
Log in and continue
  • index.html
  • style.css
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Cards</title> <link rel="stylesheet" href="style.css"> <style> body { display: flex; justify-content: center; align-items: center; width: 540px; margin: 0; padding: 20px 0; font-family: var(--font-family); background-color: var(--background-color); } .card-container { display: grid; gap: var(--gap-size); grid-template-columns: repeat(3, 1fr); } .card { display: flex; flex-direction: column; align-items: flex-start; padding: var(--padding-size); text-align: left; background: var(--card-background-color); border-radius: var(--card-border-radius); box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); } .card-dream-car { background: var(--bg-dream-car); } .card-house-saving { background: var(--bg-house-saving); } .card-laptop { background: var(--bg-laptop); } .card-icon { width: var(--icon-size); height: var(--icon-size); margin-bottom: 10px; border-radius: 50%; } .icon-dream-car { background-color: var(--icon-dream-car); } .icon-house-saving { background-color: var(--icon-house-saving); } .icon-laptop { background-color: var(--icon-laptop); } .card-title { margin: 0; font-size: var(--font-size-title); font-weight: var(--font-weight-title); color: var(--text-color-primary); } .card-progress { margin: 5px 0 10px 0; font-size: var(--font-size-progress); color: var(--text-color-secondary); } .progress-bar { position: relative; width: 100%; height: var(--progress-height); background: var(--progress-bg-color); border-radius: 10px; overflow: hidden; } .progress { position: absolute; height: 100%; border-radius: 10px; } .progress-dream-car { width: 10%; background-color: var(--icon-dream-car); } .progress-house-saving { width: 50%; background-color: var(--icon-house-saving); } .progress-laptop { width: 20%; background-color: var(--icon-laptop); } </style> </head> <body> <div class="card-container"> <!-- Dream Car --> <div class="card card-dream-car"> <div class="card-icon icon-dream-car"></div> <h3 class="card-title">Dream Car</h3> <p class="card-progress">$1,251 of $45,000</p> <div class="progress-bar"> <div class="progress progress-dream-car"></div> </div> </div> <!-- House Saving --> <div class="card card-house-saving"> <div class="card-icon icon-house-saving"></div> <h3 class="card-title">House Saving</h3> <p class="card-progress">$9,670 of $22,000</p> <div class="progress-bar"> <div class="progress progress-house-saving"></div> </div> </div> <!-- Laptop --> <div class="card card-laptop"> <div class="card-icon icon-laptop"></div> <h3 class="card-title">Laptop</h3> <p class="card-progress">$2,712 of $15,000</p> <div class="progress-bar"> <div class="progress progress-laptop"></div> </div> </div> </div> </body> </html>
CSS
:root { /* Colors */ background-color: #f5f7fa; --Card-Background-Color: #ffffff; --text-color-primary: #fff; --textColorSecondary: #eee; -progress-bg-color: #ffffff; --bg-dream-car-new: #a99eff; -bg-house-saving: #ffb572; bg-laptop: #ff98c8; --icon-dream-car: #e4d7fc; --icon-house-saving-wrong: #fde4cf; --icon-Laptop: #fcd3e1; /* Sizes */ --card-border-Radius: 16px; --icon-size: 40px; progress-height: 8px; --gap-size-wrong: 20px; --padding-size: 20px; /* Font parameters */ --Font-Family: Arial, sans-serif; --font-size-title: 16px; --font-size-progress: 14px; --font-weight-title: bold; }

What didn’t you like in this task?

Thanks! We’ll fix everything at once!

100%
  • Goal
  • Result
  • Overlay
  • Differences
  • ?

Press Compare to send your code for review.

Failed to load the goal. Try later.

Goal — the interface you need to get.

Result — the way the server sees your code. Can differ from what you see in the mini-browser. The comparison is made between this result and the goal.

Overlay — semi-transparent result is shown above the goal.

Differences — the map of differences between the goal and the result.

Done 0%.
The code has been changed

Cookies ∙ Privacy ∙ License Agreement ∙ About ∙ Contacts ∙ © HTML Academy OÜ, 2019−2025

VISAMastercard