← Back to Navigation

Navigation pattern

Wrapping site header

A small site header whose identity and navigation wrap cleanly without a menu script.

Live example

See the pattern in isolation

The preview uses the same locked-down composition policy as the Agate IDE.

PreviewSandboxed

Canonical source

Copy it, change it, keep it plain

These exact files power the preview and the IDE handoff.

Source

HTML

<header class="site-header-example" id="home">
  <a class="site-identity" href="#home">Small Hours Studio</a>
  <nav aria-label="Example navigation">
    <ul>
      <li><a href="#work" aria-current="page">Work</a></li>
      <li id="notes"><a href="#notes">Notes</a></li>
      <li id="about"><a href="#about">About</a></li>
      <li id="contact"><a href="#contact">Contact</a></li>
    </ul>
  </nav>
</header>

<main class="page-intro" id="work">
  <p>Selected work</p>
  <h1>Useful objects for everyday spaces.</h1>
</main>
Source

CSS

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: #f7efe6;
  color: #2b151d;
  font-family: system-ui, sans-serif;
}

.site-header-example {
  display: flex;
  min-height: 5rem;
  padding: 1rem clamp(1rem, 5vw, 3rem);
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  border-bottom: 4px solid #2b151d;
  background: #b0436a;
}

.site-identity {
  color: #f7efe6;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-header-example nav ul {
  display: flex;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
}

.site-header-example nav a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding: 0.45rem 0.75rem;
  color: #f7efe6;
  font-weight: 750;
  text-decoration: none;
}

.site-header-example nav a:hover,
.site-header-example nav a[aria-current="page"] {
  background: #f7efe6;
  color: #4a2c35;
}

.site-header-example a:focus-visible {
  outline: 4px solid #f7efe6;
  outline-offset: 3px;
}

.page-intro {
  padding: clamp(3rem, 12vw, 8rem) clamp(1rem, 7vw, 5rem);
  background: #d76572;
}

.page-intro p {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-intro h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(2.5rem, 10vw, 6rem);
  line-height: 0.98;
}

@media (max-width: 34rem) {
  .site-header-example {
    align-items: flex-start;
    flex-direction: column;
  }
}

How it works

A small pattern with visible decisions

The brand and navigation use ordinary links and a list, so the structure remains useful without scripting. Flex wrapping lets the navigation move below the brand when space runs out.

The current page uses aria-current="page", providing both a semantic state and a dependable styling hook.

Make it yours

Open both files in the workspace.

Agate will protect different saved work before loading this example.