Ψ§Ω†ΨͺΩ‚Ω„ Ω„Ω„Ω…Ψ­ΨͺΩˆΩ‰
Robo EgyptRobo Egypt
☰ Course contents
Robo Web: home
0. Lab tour1
1. HTML: the page's content7
2. CSS: the page's look6
3. JavaScript: the actions7
4. The project: the to-do list3
5. Pro CSS: shadows and movement5
6. Arrays and building the page with code3
7. Events and forms3
8. Objects and time3
9. Canvas: drawing and games3
10. The final project: the memory game3

πŸ› οΈ Section project: a player card

Section 2: CSS: the page's lookLesson 2.5 · ⏱ 10 min
🎯 Project goal
A card with a player's name and team, with a background, space inside and round corners, and the name in a different colour.
HTML
<div class="card">
  <h2>Mo Salah</h2>
  <p>Liverpool ⚽</p>
</div>
CSS
body { font-family: Tahoma; }
.card {
  background: #C8102E;
  color: white;
  padding: 20px;
  border-radius: 18px;
  width: 220px;
  text-align: center;
}
.card h2 {
  color: #FFD43B;
}
πŸ–₯️ The page in Robo Web:The page in Robo Web

πŸ“Œ Another example: a team card

One card with an emoji picture, a name and some facts, repeated in a row.

🌐 A team card
HTML
<div class="team">
  <div class="card"><div class="face">🦁</div><h3>Lions</h3><p>Points: 30</p></div>
  <div class="card"><div class="face">πŸ¦…</div><h3>Eagles</h3><p>Points: 24</p></div>
</div>
CSS
body { font-family: Tahoma, sans-serif; }
.card {
  width: 200px;
  margin: 10px auto;
  padding: 16px;
  text-align: center;
  border-radius: 18px;
  background: #1B2350;
  color: white;
}
.card .face { font-size: 60px; }
.team { display: flex; gap: 12px; justify-content: center; }
πŸ–₯️ The page in Robo Web:The page in Robo Web
✍️ Practise
A player card.
✍️ Practise here in the lessonor open the lab in a new page β†—

🎯 Challenge yourself

Easy

A card with an emoji and a name.

πŸ‘€ Show the solution
🌐 Solution
HTML
<div class="card"><div class="face">🐼</div><h3>Panda</h3></div>
CSS
body { font-family: Tahoma, sans-serif; }
.card {
  width: 200px;
  margin: 10px auto;
  padding: 16px;
  text-align: center;
  border-radius: 18px;
  background: #1B2350;
  color: white;
}
.card .face { font-size: 60px; }
πŸ–₯️ The page in Robo Web:The page in Robo Web

Result: a navy card.

Medium

Add a power bar to the card: a box 70% wide.

πŸ‘€ Show the solution
🌐 Solution
HTML
<div class="card">
  <div class="face">🐼</div>
  <h3>Panda</h3>
  <div class="bar"><div class="fill"></div></div>
</div>
CSS
body { font-family: Tahoma, sans-serif; }
.card {
  width: 200px;
  margin: 10px auto;
  padding: 16px;
  text-align: center;
  border-radius: 18px;
  background: #1B2350;
  color: white;
}
.card .face { font-size: 60px; }
.bar { background: #444; border-radius: 8px; }
.fill { width: 70%; height: 12px; border-radius: 8px; background: #FFBF00; }
πŸ–₯️ The page in Robo Web:The page in Robo Web

Result: a yellow bar at 70%.

Hard

Three cards in a grid of 3 columns.

πŸ‘€ Show the solution
🌐 Solution
HTML
<div class="team">
  <div class="card"><div class="face">🐼</div><h3>Panda</h3></div>
  <div class="card"><div class="face">🐯</div><h3>Tiger</h3></div>
  <div class="card"><div class="face">🐨</div><h3>Koala</h3></div>
</div>
CSS
body { font-family: Tahoma, sans-serif; }
.card {
  margin: 0;
  padding: 16px;
  text-align: center;
  border-radius: 18px;
  background: #1B2350;
  color: white;
}
.card .face { font-size: 60px; }
.team { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
πŸ–₯️ The page in Robo Web:The page in Robo Web

Result: three cards in a row.

Finished the lesson? Mark it so your progress counts.