For some reason, when putting my label and input inside a div, I can't click them. Here's my point.
#menu {
display: none;
justify-content: center;
align-items: center;
flex-direction: column;
}
#menu > a {
color:#212121;
text-align: center;
width: 100%;
background-color: darkorange;
height: 50px;
margin-bottom: 1px;
text-decoration: none;
}
#menu > .button > p {
font-family: 'Roboto'
}
#menu > a:hover {
background-color: orangered;
}
#menu > a:visited {
color:#212121;
}
------------------
.show-menu {
display: flex;
justify-content: center;
width: 100%;
text-align: center;
}
input[type=checkbox] {
display: none;
}
input[type=checkbox]:checked ~ #menu {
display: flex;
}
.show-menu {
display: block;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
text-decoration: none;
color: #fff;
background: #19c589;
text-align: center;
padding: 10px 0;
}
<body>
<div class="open">
<label for="show-menu" class="show-menu">Show Menu</label>
<input type="checkbox" id="show-menu" role="button">
</div>
<div id="menu">
<a href="#"><div class="button"><p>HOME</p></div></a>
<a href="#"><div class="button"><p>ARTICLES</p></div></a>
<a href="#"> <div class="button"><p>ADVISORS</p></div></a>
<a href="#"><div class="button"><p>HELP</p></div></a>
</div>
</body>
But if I use it outside of the .open div, it works. I tried having two of these label and input, one inside and one outside and if I do so, they both work. Still, I just want to use one.
Why is the div not allowing the input to work?
Can you help me?
Thank you!