Spaces:
Running
Running
| <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> |