Currently, I am working on creating a responsive mobile-first navigation system and exploring progressive enhancement techniques.
The objective is to target the #header element by clicking a menu icon, which will then adjust the height of the #menu to 100%, effectively displaying it when the icon is clicked.
My initial attempt was as follows:
#header:target #menu {
height:100%;
}
Unfortunately, this approach did not yield the desired results. Does anyone have any recommendations on how to modify the height of the #menu when the #header is targeted?
Edit: As I am focusing on progressively enhancing this navigation without relying on jQuery or JavaScript, I am seeking a solution that works across all devices before considering additional UX improvements. Therefore, the implementation must be done without the use of jQuery or JavaScript.
<body id="home">
<div class="wrapper">
<header id="header">
<h1 class="logo"><a href="">Nav</a></h1>
<a href="#header"> <div id="nav_btn"> </div> </a>
</header>
<nav id="primary_nav">
<ul id="menu">
<li><a href="">Portfolio</a></li>
<li><a href="">About Me</a></li>
<li><a href="">Nonsense</a></li>
<li><a href="">Services</a></li>
<li><a href="">Contact</a></li>
</ul>
</nav><!--end primary_nav-->
</div><!--end wrapper-->
</body>