<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flexbox Layout</title>
<link rel="stylesheet" href="flexbox-style.css">
</head>
<body>
<header class="main-header">Header</header>
<nav class="main-nav">Navigation</nav>
<section class="main-content">Content</section>
<aside class="sidebar">Sidebar</aside>
<footer class="main-footer">Footer</footer>
</body>
</html>
body {
margin: 0;
font-family: Arial, sans-serif;
}
.main-header, .main-nav, .main-footer {
text-align: center;
padding: 1rem;
background-color: #333;
color: white;
}
.main-content, .sidebar {
padding: 1rem;
}
/* Flexbox container */
body {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.main-content {
flex: 1;
}
/* Responsive design */
@media (min-width: 768px) {
body {
flex-direction: row;
}
.main-nav, .main-content, .sidebar {
flex: 1;
}
.sidebar {
order: -1; /* Move sidebar to the left side */
}
}