Spaces:
Running
Running
File size: 3,992 Bytes
11bef44 |
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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Responsive Web Page</title>
<style>
/* CSS Variables for consistent theming */
:root {
--primary-color: #3498db;
--secondary-color: #2c3e50;
--background-color: #f4f4f4;
--card-bg: #ffffff;
--text-color: #333333;
--spacing-unit: 16px;
--border-radius: 8px;
--box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
color: var(--text-color);
background-color: var(--background-color);
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.container {
width: 100%;
max-width: 800px;
padding: var(--spacing-unit);
}
header {
text-align: center;
margin-bottom: var(--spacing-unit);
}
h1 {
color: var(--secondary-color);
margin-bottom: 0.5em;
}
.card {
background-color: var(--card-bg);
border-radius: var(--border-radius);
box-shadow: var(--box-shadow);
padding: var(--spacing-unit);
margin-bottom: var(--spacing-unit);
}
.card-header {
font-weight: bold;
font-size: 1.2em;
margin-bottom: var(--spacing-unit);
border-bottom: 2px solid var(--primary-color);
padding-bottom: 0.5em;
}
p {
margin-bottom: var(--spacing-unit);
}
.code-block {
background-color: #2d2d2d;
color: #f8f8f2;
padding: var(--spacing-unit);
border-radius: var(--border-radius);
overflow-x: auto;
font-family: 'Courier New', Courier, monospace;
font-size: 0.9em;
}
.footer {
text-align: center;
margin-top: var(--spacing-unit);
font-size: 0.8em;
color: #777;
}
.footer a {
color: var(--primary-color);
text-decoration: none;
}
/* Responsive adjustments */
@media (max-width: 600px) {
.container {
padding: var(--spacing-unit) * 0.5;
}
.card {
padding: var(--spacing-unit) * 0.5;
}
}
</style>
</head>
<body>
<div class="container">
<header>
<h1>Responsive Web Page</h1>
<p>This is a responsive web page demonstrating modern CSS.</p>
</header>
<main>
<section class="card">
<div class="card-header">Concept</div>
<p>This page uses CSS variables, Flexbox for layout, and Media Queries for responsiveness. It adapts to different screen sizes, from mobile phones to desktop computers.</p>
</section>
<section class="card">
<div class="card-header">Example Code</div>
<p>The following CSS demonstrates how to define variables and use Flexbox:</p>
<div class="code-block">
<pre>:root {
--primary-color: #3498db;
--spacing-unit: 16px;
}
.container {
display: flex;
flex-direction: column;
gap: var(--spacing-unit);
}
@media (max-width: 600px) {
.container {
padding: 8px;
}
}</pre>
</div>
</section>
</main>
<footer class="footer">
<p>Built with anycoder</p>
<a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">Built with anycoder</a>
</footer>
</div>
</body>
</html> |