Step 3 of 10

CSS - Making it Pretty

📖 Lesson

What is CSS?

CSS (Cascading Style Sheets) is the language that defines how HTML elements look.

HTML = what's on the page. CSS = how it looks.

h1 {
  color: #00d4aa;
  font-size: 32px;
}

This says: all <h1> headings will be green and 32px large.

Basic CSS properties

  • color - Text color
  • background - Background (color, gradient, image)
  • font-size - Font size
  • padding - Inner spacing
  • margin - Outer spacing
  • border-radius - Rounded corners
  • box-shadow - Element shadow

Modern CSS tricks

With CSS you can create amazing effects:

  • Gradients - smooth color transitions
  • Hover effects - changes on mouse hover
  • Shadows - depth and 3D feel
  • Flexbox - easy element alignment
Don't be afraid to experiment! Changing one CSS value can completely transform the look. Tell AI "change the color to blue" and watch it change.
💻 Example to try
index.php
🚀 Try on Vibmy
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS Cards</title>
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            min-height: 100vh;
            background: linear-gradient(135deg, #0f0c29 0%, #1a1a3e 50%, #0f2027 100%);
            font-family: "Segoe UI", system-ui, sans-serif;
            padding: 2rem;
        }

        h1 {
            text-align: center;
            font-size: 2.5rem;
            background: linear-gradient(to right, #00d4aa, #7b68ee, #ff6b9d);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 0.5rem;
        }

        .subtitle {
            text-align: center;
            color: #6b7280;
            margin-bottom: 3rem;
            font-size: 1.1rem;
        }

        .grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 2rem;
            max-width: 1200px;
            margin: 0 auto;
        }

        .card {
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 20px;
            padding: 2rem;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            position: relative;
            overflow: hidden;
        }

        .card::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            border-radius: 20px 20px 0 0;
            transition: height 0.4s;
        }

        .card:nth-child(1)::before { background: linear-gradient(to right, #00d4aa, #00b4d8); }
        .card:nth-child(2)::before { background: linear-gradient(to right, #7b68ee, #a78bfa); }
        .card:nth-child(3)::before { background: linear-gradient(to right, #ff6b9d, #ffa07a); }
        .card:nth-child(4)::before { background: linear-gradient(to right, #f59e0b, #ef4444); }
        .card:nth-child(5)::before { background: linear-gradient(to right, #10b981, #3b82f6); }
        .card:nth-child(6)::before { background: linear-gradient(to right, #ec4899, #8b5cf6); }

        .card:hover {
            transform: translateY(-10px) scale(1.02);
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
            border-color: rgba(255, 255, 255, 0.15);
        }

        .card:hover::before { height: 4px; }

        .card-icon {
            font-size: 2.5rem;
            margin-bottom: 1rem;
            display: block;
        }

        .card h3 {
            color: #f0f0f0;
            font-size: 1.3rem;
            margin-bottom: 0.8rem;
        }

        .card p {
            color: #8892a4;
            font-size: 0.95rem;
            line-height: 1.7;
            margin-bottom: 1.5rem;
        }

        .card-tag {
            display: inline-block;
            padding: 0.3rem 0.8rem;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 600;
            letter-spacing: 0.5px;
            text-transform: uppercase;
        }

        .card:nth-child(1) .card-tag { background: rgba(0,212,170,0.15); color: #00d4aa; }
        .card:nth-child(2) .card-tag { background: rgba(123,104,238,0.15); color: #a78bfa; }
        .card:nth-child(3) .card-tag { background: rgba(255,107,157,0.15); color: #ff6b9d; }
        .card:nth-child(4) .card-tag { background: rgba(245,158,11,0.15); color: #f59e0b; }
        .card:nth-child(5) .card-tag { background: rgba(16,185,129,0.15); color: #10b981; }
        .card:nth-child(6) .card-tag { background: rgba(236,72,153,0.15); color: #ec4899; }

        @media (max-width: 600px) {
            h1 { font-size: 1.8rem; }
            .grid { grid-template-columns: 1fr; }
            body { padding: 1rem; }
        }
    </style>
</head>
<body>
    <h1>CSS Cards</h1>
    <p class="subtitle">Hover over a card and watch the effect</p>

    <div class="grid">
        <div class="card">
            <span class="card-icon">&#x1F680;</span>
            <h3>Quick Start</h3>
            <p>Start coding in minutes. No installation, no configuration. Just an idea and AI.</p>
            <span class="card-tag">Beginners</span>
        </div>
        <div class="card">
            <span class="card-icon">&#x1F3A8;</span>
            <h3>Beautiful Design</h3>
            <p>Gradients, shadows, animations - everything that makes the web modern and attractive.</p>
            <span class="card-tag">CSS</span>
        </div>
        <div class="card">
            <span class="card-icon">&#x26A1;</span>
            <h3>Interactivity</h3>
            <p>Buttons, forms, animations - a page that responds to users.</p>
            <span class="card-tag">JavaScript</span>
        </div>
        <div class="card">
            <span class="card-icon">&#x1F5A5;&#xFE0F;</span>
            <h3>Server Logic</h3>
            <p>PHP processes data on the server. Forms, databases, dynamic content.</p>
            <span class="card-tag">PHP</span>
        </div>
        <div class="card">
            <span class="card-icon">&#x1F916;</span>
            <h3>AI Assistant</h3>
            <p>Tell AI what you want and it writes the code for you. That's how vibe coding works!</p>
            <span class="card-tag">AI</span>
        </div>
        <div class="card">
            <span class="card-icon">&#x1F30D;</span>
            <h3>Online in Seconds</h3>
            <p>Deploy on Vibmy and your page is on the internet. With its own address.</p>
            <span class="card-tag">Vibmy</span>
        </div>
    </div>
</body>
</html>
← Back 3 / 10 Next step →