Two-tier navigation in HTML and CSS
A strip of practical details (phone, opening hours) above the main navigation.
Here is an excerpt of this component's code in HTML and CSS. The full code is free for members, ready to copy into your project.
This component also comes in
The code in HTML and CSS
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Navigation à double niveau</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="demo">
<header class="tier" data-nav>
<div class="tier__info">document.querySelectorAll("[data-nav]").forEach((nav) => {
const toggle = nav.querySelector("[data-nav-toggle]");
const setOpen = (open) => {
nav.toggleAttribute("data-open", open);
toggle.setAttribute("aria-expanded", String(open));
};
toggle.addEventListener("click", () => setOpen(!nav.hasAttribute("data-open")));
nav.addEventListener("keydown", (event) => {
if (event.key === "Escape" && nav.hasAttribute("data-open")) {
setOpen(false);
toggle.focus();
}:root {
--tier-info-bg: #292524;
--tier-info-text: #e7e5e4;
--tier-bg: #fffbeb;
--tier-border: #fde68a;
--tier-text: #292524;
--tier-accent: #92400e;
--tier-cta: #f59e0b;
--tier-cta-text: #1c1003;
--tier-ring: #b45309;
--demo-bg: #fffdf5;
--demo-text: #44403c;Free component: copy it freely, including for commercial projects.
Other navigation bars components in HTML and CSS
Navigation bars components in HTML and CSS
A navigation that sits at the bottom of the screen, under the thumb, on phones, and becomes a horizontal bar at the top on desktop.
- Tailwind
- React
- CSS
- WordPress

Logo on the left, links in the middle, call to action on the right, collapsible menu on mobile.
- Tailwind
- React
- CSS
- WordPress

The house name in the middle, links split on each side, restaurant or designer-shop style.
- Tailwind
- React
- CSS
- WordPress