Page Layout

A Typical Page Layout

Most websites follow the same pattern: a header with the logo and navigation, the main content, perhaps a sidebar, and a footer. The structure is HTML; the arrangement is CSS (Flexbox or Grid).

Example

Example

<!DOCTYPE html>
<html>
<head>
  <title>Page Title</title>
  <style>
      body { font-family: Arial, sans-serif; margin: 0; }
      header, footer { background: #282A35; color: white; padding: 12px 20px; }
      header a { color: #04AA6D; }
      .row { display: flex; gap: 16px; padding: 16px 20px; }
      main { flex: 3; }
      aside { flex: 1; background: #f1f1f1; padding: 0 12px; }
    </style>
</head>
<body>

<header>
  <h1>My Website</h1>
  <nav><a href="#">Home</a> | <a href="#">Courses</a> | <a href="#">Contact</a></nav>
</header>
<div class="row">
  <main>
    <h2>Welcome</h2>
    <p>The main content of the page goes here.</p>
  </main>
  <aside>
    <h3>News</h3>
    <p>New SQL course released!</p>
  </aside>
</div>
<footer>© 2024 My Website</footer>

</body>
</html>

Result