I’m somehow not able to access my toggle_button correctly.
I have hidden the ul and li elements with a breakpoint using display:none and want to show them again using a checkbox. Unfortunately it doesn’t work and I don’t know why. I’ve already tried 3 million selectors for “toggle_button:checked XYZ”. Somehow I’m not able to access the correct selector?!
<header>
<section class="header_empty">
</section>
<section class="header_logo">
<a href=""><img class ="schriftzug" src="XXX" alt="XXX" width="100%"></a>
</section>
<section class="header_nav">
<div class="nav_container">
<nav class="burger_menu">
<input type="checkbox" id="toggle_button">
<label for="toggle_button">
<img class="toggle_button_icon" src="img/menu.svg" alt="" width="40px">
</label>
</nav>
<nav class="nav_social">
<ul>
<li><a href="#"><img src="img/codepen_grau.svg" alt="Icon Codepen" onmouseover="src='img/codepen_pink.svg'" onmouseout="src='img/codepen_grau.svg'" width="30px"></a></li>
<li><a href="#"><img src="img/github_grau.svg" alt="Icon GitHub" onmouseover="src='img/github_pink.svg'" onmouseout="src='img/github_grau.svg'" width="30px"></a></li>
<li><a href="#"><img src="img/instagram_grau.svg" alt="Icon Instagram" onmouseover="src='img/instagram_pink.svg'" onmouseout="src='img/instagram_grau.svg'" width="30px"></a></li>
<li><a href="#"><img src="img/linkedin_grau.svg" alt="Icon Linkedin" onmouseover="src='img/linkedin_pink.svg'" onmouseout="src='img/linkedin_grau.svg'" width="30px"></a></li>
<li><a href="#"><img src="img/xing_grau.svg" alt="Icon Xing" onmouseover="src='img/xing_pink.svg'" onmouseout="src='img/xing_grau.svg'" width="30px"></a></li>
</ul>
</nav>
<nav class="nav_main">
<ul>
<li><a href="about.html">About</a></li>
<li><a href="print.html">Print</a></li>
<li><a href="web.html">Web</a></li>
<li><a href="kontakt.html">Kontakt</a></li>
</ul>
</nav>
</div>
</section>
</header>
header {
background-color: #fdb9ce;
width: 85%;
display: grid;
grid-template-columns: 33% 33% 33%;
margin: 0 auto;
align-items: end;
}
/*--------- Navigation Einstellungen ---------*/
.nav_container {
display: flex;
flex-direction: column;
align-items: end;
}
.nav_social ul {
display: flex;
}
.nav_main ul {
display: flex;
}
li {
list-style-type: none;
margin: 5px 0;
}
li a {
text-decoration: none;
padding: 5px;
color: var(--text-color-middle);
}
/*--------- Bürger Menü ---------*/
@media(max-width: 900px){
ul li {
display: none;
}
#toggle_button:checked ul li {
display: flex;
}
}