Skip to main content
tags editadas
Link
hugocsl
  • 66,9mil
  • 17
  • 88
  • 166
tradução
Fonte Link
hugocsl
  • 66,9mil
  • 17
  • 88
  • 166

Label ande Checkbox not workingnão estão funcionando

I created a checkbox with the id="navToggle" to show theEu criei uma caixa de seleção com o id = "navToggle" para mostrar o "nav" and intended to usee pretendia usar a label with the for pointiong to that checkboxlabel com o for apontando para esse checkbox, but for some reason when i click themas por algum motivo quando eu clico no X nothing happensnada acontece. The checkbox works fine thoO checkbox funciona bem. Below there is the Abaixo, há o código css3 code i used to show theque eu usei para mostrar o menu when the checkbox is checkedquando checkbox está marcado e, and then there is theem seguida, há o HTML. Please helpPor favor ajude. ThanksObrigado.

.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>

Label and Checkbox not working

I created a checkbox with the id="navToggle" to show the "nav" and intended to use a label with the for pointiong to that checkbox, but for some reason when i click the X nothing happens. The checkbox works fine tho. Below there is the css3 code i used to show the menu when the checkbox is checked, and then there is the HTML. Please help. Thanks.

.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>

Label e Checkbox não estão funcionando

Eu criei uma caixa de seleção com o id = "navToggle" para mostrar o "nav" e pretendia usar a label com o for apontando para esse checkbox, mas por algum motivo quando eu clico no X nada acontece. O checkbox funciona bem. Abaixo, há o código css3 que eu usei para mostrar o menu quando checkbox está marcado e, em seguida, há o HTML. Por favor ajude. Obrigado.

.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>

Fonte Link
Caput
  • 21
  • 2

Label and Checkbox not working

I created a checkbox with the id="navToggle" to show the "nav" and intended to use a label with the for pointiong to that checkbox, but for some reason when i click the X nothing happens. The checkbox works fine tho. Below there is the css3 code i used to show the menu when the checkbox is checked, and then there is the HTML. Please help. Thanks.

.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>