Site header
A sticky dark navigation bar with an accent line on top, a brand mark and wordmark, links, and one call-to-action button. On a phone the links fold into a Menu button that needs no JavaScript. Use it once, at the top of every page. Mark the link for the current page with aria-current="page".
<header class="blk-section blk-dark blk-sitehead">
<div class="blk-container blk-sitehead__bar">
<a class="blk-brand" href="#" aria-label="Your brand, home">
<svg class="blk-brand__mark" viewBox="0 0 100 100" fill="none" stroke="currentColor" stroke-width="11" aria-hidden="true"><polyline points="10,40 10,10 40,10"/><polyline points="60,10 90,10 90,40"/><polyline points="90,60 90,90 60,90"/><polyline points="40,90 10,90 10,60"/></svg>
<span class="blk-brand__name">Your Brand</span>
</a>
<nav class="blk-nav" aria-label="Primary">
<ul class="blk-nav__list">
<li><a href="#" aria-current="page">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Articles</a></li>
<li><a class="blk-btn blk-btn--outline" href="#">Contact</a></li>
</ul>
<details class="blk-nav__menu">
<summary>Menu</summary>
<ul>
<li><a href="#" aria-current="page">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Articles</a></li>
<li><a href="#">Contact</a></li>
</ul>
</details>
</nav>
</div>
</header>.blk-sitehead.blk-section { position: sticky; top: 0; z-index: 50; padding: 0; background: var(--blk-dark); border-top: 4px solid var(--blk-accent); }
.blk-sitehead__bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.blk-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--blk-on-dark); text-decoration: none; }
.blk-brand__mark { width: 38px; height: 38px; flex: 0 0 auto; stroke-linecap: butt; }
.blk-brand__name { font-family: var(--blk-font-heading); font-weight: 700; font-size: 1.05rem; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.blk-nav__list { list-style: none; margin: 0; padding: 0; display: none; align-items: center; gap: 28px; }
.blk-nav__list a:not(.blk-btn), .blk-nav__menu a { position: relative; color: var(--blk-on-dark); text-decoration: none; font-family: var(--blk-font-heading); font-weight: 500; font-size: .92rem; padding: 6px 0; }
.blk-nav__list a:not(.blk-btn)::after { content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 2px; background: var(--blk-on-dark); transition: width .25s ease; }
.blk-nav__list a:not(.blk-btn):hover::after, .blk-nav__list a[aria-current="page"]::after { width: 100%; }
.blk-nav__list .blk-btn { padding: 8px 18px; font-size: .85rem; }
.blk-nav__menu { position: relative; }
.blk-nav__menu summary { list-style: none; cursor: pointer; font-family: var(--blk-font-heading); font-weight: 600; font-size: .9rem; color: var(--blk-on-dark); border: 1px solid rgba(255,255,255,.4); border-radius: 6px; padding: 9px 16px; }
.blk-nav__menu summary::-webkit-details-marker { display: none; }
.blk-nav__menu[open] summary { background: rgba(255,255,255,.12); }
.blk-nav__menu ul { list-style: none; margin: 0; padding: 8px 0; position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; background: var(--blk-dark); border: 1px solid rgba(255,255,255,.18); border-radius: var(--blk-radius); box-shadow: var(--blk-shadow); }
.blk-nav__menu li a { display: block; padding: 12px 20px; }
.blk-nav__menu a[aria-current="page"] { color: var(--blk-on-dark-accent); }
@media (min-width: 900px) {
.blk-nav__list { display: flex; }
.blk-nav__menu { display: none; }
}
.blk-nav { display: flex; align-items: center; }How to customise it
- Replace the wordmark and the mark. The mark is inline SVG using currentColor, so it takes the text colour.
- Keep five or six links at most. Put the one action you want in the button on the right.
- The mobile menu is a native details element, so it works with no script. The link list appears twice in the markup, once for each size; keep both lists the same.
- Mark the current page with aria-current="page" and the link gets its underline.
Tokens it reads
--blk-dark--blk-accent--blk-on-dark--blk-font-headingAdd the "Site header" block from Product Scope Blocks (https://resources.productscope.uk/blocks/blocks/site-header) to my page. Link https://resources.productscope.uk/blocks/blocks/kit/blocks.css once. Paste the HTML from https://resources.productscope.uk/blocks/blocks/kit/blocks/site-header.html and replace the placeholder text with my real content. Do not change the class names, add inline styles or add scripts. To change colours or fonts, override the --blk- variables in my own CSS. Do not invent facts, clients or numbers.