๐ŸŸข LESSON 2 PRACTICAL

๐ŸŸข LESSON 2 PRACTICAL โ€” Colors, Backgrounds & Card Design

๐ŸŽฏ Goal

You will learn:

  • Better colors ๐ŸŽจ
  • Background styling ๐ŸŒ„
  • Build your first card UI (real-world component)

๐Ÿงพ STEP 1: Update Your HTML

Replace your index.html with this:

<!DOCTYPE html>
<html>
<head>
    <title>CSS Lesson 2</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>

    <div class="card">
        <h1>Welcome to CSS</h1>
        <p>This is my first styled card.</p>
        <button>Learn More</button>
    </div>

</body>
</html>

๐ŸŽจ STEP 2: Style Background

Update style.css:

body {
    background: linear-gradient(to right, #4facfe, #00f2fe);
    font-family: Arial, sans-serif;
}

๐Ÿ‘‰ Now your background becomes a gradient (modern UI style)

๐Ÿ“ฆ STEP 3: Build a Card (IMPORTANT ๐Ÿ”ฅ)

.card {
    background: white;
    width: 300px;
    padding: 20px;
    margin: 100px auto;
    border-radius: 10px;
    text-align: center;
}

โœจ STEP 4: Add Shadow (makes it professional)

.card {
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

๐ŸŽฏ STEP 5: Style Text

h1 {
    color: #333;
}

p {
    color: #666;
}

๐Ÿ”˜ STEP 6: Style Button

button {
    background: #4facfe;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
}

๐Ÿš€ STEP 7: Add Hover Effect (feels alive ๐Ÿ”ฅ)

button:hover {
    background: #00c6ff;
}

๐ŸŽฏ FINAL RESULT

You now have:

  • Gradient background ๐ŸŒˆ
  • Centered card ๐Ÿ“ฆ
  • Styled button ๐Ÿ”˜
  • Hover interaction โœจ

๐Ÿ‘‰ This is already real frontend development

๐Ÿงช CHALLENGE (IMPORTANT)

Improve your design:

  1. Increase card width
  2. Change gradient colors
  3. Add:
.card {
    transition: 0.3s;
}

.card:hover {
    transform: scale(1.05);
}

๐Ÿ‘‰ This adds animation when hovering


๐Ÿ’ก THINK LIKE A PRO

This โ€œcardโ€ is used everywhere:

  • Blogs
  • Dashboards
  • Apps
  • Portfolios

You just built a reusable UI component ๐Ÿ’ผ

You may also like...

18 Responses

  1. Excellent resource that I will be returning to regularly, the depth of coverage combined with the accessible writing style makes it suitable for both beginners and experienced readers.

  2. This is precisely the kind of detailed and well-researched content that the internet needs more of, it is clear the author cares deeply about providing genuine value to readers.

  3. I found myself nodding along throughout this entire article because every point resonated and felt grounded in real understanding rather than recycled information from other sources.

  4. A well-researched and thoughtfully presented piece that earns the reader’s trust through its honesty, depth, and the obvious care that has gone into every aspect of its creation.

  5. This post was remarkably insightful, breaking down complex ideas into simple and accessible points so thank you for taking the time to put something this good together.

  6. Semogseguros says:

    The content here was quite impressive, supporting every claim with solid reasoning and real examples. This is the kind of article that reminds me why good writing still matters online.

  1. April 11, 2026

    […] Next Lesson […]

  2. April 11, 2026

    […] Previous Lesson Next Lesson […]

  3. June 20, 2026

    ketoconazole mechanism of action

    ketoconazole mechanism of action

  4. June 20, 2026

    terbinafine side effects expert overview

    terbinafine side effects expert overview

Leave a Reply

Your email address will not be published. Required fields are marked *