summaryrefslogtreecommitdiff
path: root/css/03-embedded-css-utility-classes
diff options
context:
space:
mode:
Diffstat (limited to 'css/03-embedded-css-utility-classes')
-rw-r--r--css/03-embedded-css-utility-classes/index.html79
1 files changed, 79 insertions, 0 deletions
diff --git a/css/03-embedded-css-utility-classes/index.html b/css/03-embedded-css-utility-classes/index.html
new file mode 100644
index 0000000..17eb0ba
--- /dev/null
+++ b/css/03-embedded-css-utility-classes/index.html
@@ -0,0 +1,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>
+