Skip to content
HTML Templates For Developers

Masthead — Responsive Header Templates

Five copy-ready responsive HTML headers: simple, centered logo, mega menu, search with actions, and a transparent hero header that turns solid on scroll.

FreeVanilla HTMLOne-page
Masthead — Responsive Header Templates — template preview

Live preview

This is the actual template running in a sandbox, shown at 1280px wide.

Description

Masthead is a single page holding five different site headers, each shown on its own demo band so you can judge it in context. Every header is a self-contained block of HTML with its own numbered CSS section, so you can lift one into a project without untangling the others.

All five collapse into a menu button below 900px and work with the keyboard. Dropdowns and mega panels open on click or Enter, close on Escape or an outside click, and return focus to the button that opened them. On phones the mega menu becomes a simple accordion.

The behaviour lives in one small script driven by data attributes (data-menu-toggle, data-dropdown, data-search-toggle, data-solid-on-scroll), so a copied header works without editing JavaScript. Colours, heights and hover states are CSS custom properties; each header re-themes by overriding a handful of --mh-* tokens.

Key features

  • Five distinct headers: simple, centered logo, mega menu, search and actions, transparent hero
  • Working mobile menu on every header with aria-expanded state and Escape to close
  • Keyboard-accessible dropdowns that close on Escape, outside click and focus loss
  • Mega menu with two grouped panels and featured cards, accordion on phones
  • Header that starts transparent over a hero and turns solid after a set scroll distance
  • Search field that collapses behind an icon on phones, plus a cart badge that updates
  • Each header has its own numbered CSS section and shared base for easy copying
  • Re-theme any header through --mh-* custom properties
  • Self-hosted Hanken Grotesk, inline SVG icons, no dependencies or external requests
  • Respects prefers-reduced-motion and has visible focus styles

Front-end template: what is demonstration only

  • The header search field is not connected to anything; submitting it only shows a demo message.
  • The cart badge in header 4 counts button clicks and stores nothing.
  • All brand names, links and menu items are fictional placeholders.

What is included

Pages and sections

  • Introduction and jump links
  • Header 1: simple inline with dropdown
  • Header 2: centered logo
  • Header 3: mega menu with featured cards
  • Header 4: search, sign-in and cart
  • Header 5: transparent over hero, solid on scroll

Framework

Plain HTML5, CSS3 and JavaScript. No framework, no build step — open index.html and edit.

Bundled open-source components

  • Hanken Grotesk typeface (OFL-1.1)
  • Lucide icons (inlined SVG) (ISC)

Everything is inside the download with its licence. Nothing loads from a CDN.

Supported browsers

Chrome, Edge, Firefox, Safari, Opera

Current versions. Checked in Chromium at desktop, tablet and phone widths.

Files in the download (10) · 58 KB ZIP
  • LICENSE.txt1.3 KB
  • README.md2.6 KB
  • assets/css/style.css19 KB
  • assets/fonts/hanken-grotesk-LICENSE.txt4.4 KB
  • assets/fonts/hanken-grotesk-latin-wght-normal.woff234 KB
  • assets/images/favicon.svg336 B
  • assets/js/main.js6.6 KB
  • documentation/index.html11 KB
  • documentation/licenses/lucide-LICENSE.txt3.1 KB
  • index.html24 KB

Includes a README, a documentation page with customisation notes, and the licence text.

Read the documentation

Changelog

  1. Version 1.0.0 Nov 23, 2026Current

    • Initial release.

Licence

Free Template Licence. Use it in unlimited personal and commercial projects, modify it freely and use it in client work. You may not redistribute or resell the template itself. Attribution is appreciated, not required.

Read the full licence terms

Customer reviews

No reviews yet. Reviews come only from customers who have downloaded or bought this template.

Write a review