Я пытался просмотреть свой код несколько раз, и я до сих пор не вижу причины, почему это не работает. Вот мой код HTML и CSS (с флажком, я старался пока не использовать JS):
Код: Выделить всё
Test
[i]
[/i]
Test
[list]
[*][url=http://localhost/list]Test1[/url]
[*][url=http://localhost/about]Test2[/url]
[*][url=http://localhost/faq]Test3[/url]
[*][url=http://localhost/contact]Test4[/url]
[/list]
Код: Выделить всё
*{
padding: 0;
margin: 0;
text-decoration: none;
list-style: none;
box-sizing: border-box;
}
body{
font-family: "Roboto","Arial",sans-serif;
}
nav{
background: #4287f5;
height: 80px;
width: 100%;
}
label.logo{
color: white;
font-size: 35px;
line-height: 80px;
padding: 0 100px;
font-weight: bold;
cursor: pointer;
}
nav ul{
float: right;
margin-right: 20px;
}
nav ul li{
display: inline-block;
line-height: 80px;
margin: 0 5px;
}
nav ul li a{
color: white;
font-size: 17px;
text-transform: uppercase;
}
a.active,a:hover{
background: #57aef2;
transition: .5s;
}
.checkbtn{
font-size: 30px;
color: white;
float: right;
line-height: 80px;
margin-right: 40px;
cursor: pointer;
display: none;
}
#check{
display: none;
}
@media (max-width: 952px){
label.logo{
font-size: 30px;
padding-left: 50px;
}
nav ul li a{
font-size: 16px;
}
}
@media (max-width: 858px){
.checkbtn{
display: block;
}
ul{
position: fixed;
width: 100%;
height: 100vh;
background: #1b354a;
top: 80px;
left: 0;
text-align: center;
transition: all .5s;
}
nav ul li{
display: block;
margin: 50px 0;
line-height: 30px;
}
nav ul li a{
font-size: 20px;
}
a:hover,a.active{
background: none;
color: #57aef2;
}
#check:checked ~ ul{
left: 0;
}
}
Подробнее здесь: https://stackoverflow.com/questions/792 ... ng-happens
Мобильная версия