index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!-- Mandatory Responsive Viewport Tag -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Responsive Web Design Demo</title>
<style>
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; margin: 0; padding: 20px; line-height: 1.6; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 20px; }
img.responsive-img { width: 100%; height: auto; border-radius: 6px; }
</style>
</head>
<body>
<h1>Responsive Web Layout</h1>
<p>Resize your browser window to see these cards reflow automatically without horizontal scrollbars.</p>
<div class="grid-cards">
<div class="card">
<img class="responsive-img" src="https://images.unsplash.com/photo-1517694712202-14dd9538aa97?w=500" alt="Laptop displaying code">
<h3>Responsive Card 1</h3>
<p>Automatically stacks on mobile and reflows into multiple columns on wide desktop monitors.</p>
</div>
<div class="card">
<img class="responsive-img" src="https://images.unsplash.com/photo-1555066931-4365d14bab8c?w=500" alt="Programmer typing on keyboard">
<h3>Responsive Card 2</h3>
<p>Built with auto-fit CSS Grid and fluid HTML images.</p>
</div>
</div>
</body>
</html>