由于某些原因,将标签和输入内容放入div时,无法单击它们。这是我的意思。
#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; …Run Code Online (Sandbox Code Playgroud)