1
I created a checkbox with id = "navToggle" to show the "Nav" and intended to use the label
with the for
pointing to this checkbox
, but for some reason when I click on the X nothing happens. The checkbox
works well. Below is the css3 code I used to show the menu when checkbox
is marked and then there is HTML. Please help. Thank you.
.nav-toggle:checked ~ nav{
display: block;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>FirstPage</title>
</head>
<body>
<link rel="stylesheet" href="navMenuStyle.css" />
<header>
<h1 class="logo">S.Gibas</h1>
<input type="checkbox" class="nav-toggle" id="navToggle" />
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Contacts</a></li>
<li><a href="#">News</a></li>
</ul>
</nav>
<lable for="navToggle" class="nav-toggle-lable">
<span>X</span>
</lable>
</header>
</body>
</html>
Edit your question and write in English ok.
– hugocsl