summaryrefslogtreecommitdiff
path: root/css/03-embedded-css-utility-classes/index.html
blob: 17eb0ba04e8e1048bed635a1a7e238bef5e24bb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Embedded CSS Example</title>
    <style>
        /* --- REUSABLE UTILITY CLASSES --- */
        
        /* Flexbox center utility */
        .flex-center {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            font-family: Arial, sans-serif;
            background-color: #f4f7f6;
        }

        /* Card Component */
        .card {
            background-color: #ffffff;
            padding: 24px;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            max-width: 400px;
            text-align: center;
        }

        /* Base Button */
        .btn {
            display: inline-block;
            padding: 12px 24px;
            font-size: 16px;
            font-weight: bold;
            text-decoration: none;
            border-radius: 6px;
            border: none;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }

        /* Button Modifiers for Reusability */
        .btn-primary {
            background-color: #007bff;
            color: #ffffff;
        }
        
        .btn-primary:hover {
            background-color: #0056b3;
        }

        .btn-secondary {
            background-color: #6c757d;
            color: #ffffff;
            margin-left: 10px;
        }

        .btn-secondary:hover {
            background-color: #5a6268;
        }
    </style>
</head>
<body class="flex-center">

    <div class="card">
        <h2>Welcome Back</h2>
        <p>This is a reusable embedded CSS setup. Both buttons below share the base <strong>.btn</strong> rule, but use different modifiers.</p>
        
        <div style="margin-top: 20px;">
            <a href="#" class="btn btn-primary">Sign In</a>
            <a href="#" class="btn btn-secondary">Learn More</a>
        </div>
    </div>

</body>
</html>