How the header navigation and responsive menu system work
Proyecto Neptuno features a consistent navigation pattern across all pages, with a responsive hamburger menu for mobile devices. The entire system is built with pure HTML and CSS — no JavaScript required.
The hamburger menu uses a checkbox hack for CSS-only interaction:
HTML Structure
CSS - Checkbox
CSS - Hamburger Icon
CSS - Mobile Menu
<!-- Hidden checkbox controls menu state --><input type="checkbox" id="btn-menu"><!-- Label acts as the clickable hamburger icon --><label for="btn-menu" class="hamburger"> <span class="line"></span> <span class="line"></span> <span class="line"></span></label><!-- Navigation menu (slides in when checkbox is checked) --><nav> <ul> <li><a href="./index.html">Inicio</a></li> <!-- More links --> </ul></nav>
/* Always hide the checkbox */#btn-menu { display: none;}
The checkbox is never visible but controls the menu state through CSS.
The hamburger is hidden on desktop and only appears on mobile.
@media (max-width: 768px) { /* Show hamburger on mobile */ .hamburger { display: flex; } /* Position menu off-screen */ header nav { position: fixed; top: 10vh; left: -100%; /* Hidden to the left */ width: 100%; height: 45vh; background-color: var(--bg-secundario); transition: all 0.4s ease; display: block; border-bottom: 1px solid #e0e0e0; } /* Vertical link layout */ header ul { flex-direction: column; justify-content: space-evenly; height: 100%; } /* Slide menu in when checkbox is checked */ #btn-menu:checked ~ nav { left: 0; }}
When the checkbox is checked (by clicking the label), the ~ sibling selector reveals the menu.
@media (max-width: 768px) { .hamburger { display: flex; /* Show hamburger */ } header nav { position: fixed; top: 10vh; left: -100%; width: 100%; height: 45vh; transition: all 0.4s ease; } header ul { flex-direction: column; justify-content: space-evenly; } #btn-menu:checked ~ nav { left: 0; }}
Features:
Hamburger menu activated
Slide-in panel from left
Vertical link stacking
Mobile uses the same hamburger menu as tablet, with inherited styles from the 768px breakpoint.The menu height (45vh) ensures it doesn’t cover the entire screen, maintaining context.
No JavaScript Required: The entire navigation system, including the mobile hamburger menu, works with pure HTML and CSS using the checkbox hack technique.
Header is consistent across all pages
Hamburger menu uses checkbox + label + sibling selector