0
I did a btn:checked that should expand the container . side-bar, but it does not expand!
I tried to put it before the side-bar in html, it before it in css, they 2 at the same time before it and still doesn’t work.
HTML:
<div class="side-bar">
<div class="menu">
<input class="menu-btn" type="checkbox" id="menu-btn">
<label class="menu-icon" for="menu-btn"><img src="img/menu.png" class="menu-icon"></label>
</div>
<div class="social-links">
<ul>
<li><a href="#"><img src="img/fb.png"></a></li>
<li><a href="#"><img src="img/ig.png"></a></li>
<li><a href="#"><img src="img/tw.png"></a></li>
</ul>
</div>
CSS:
.side-bar {
width: 50px;
height: 100vh;
position: absolute;
background: linear-gradient(#00545d, #000729);
right: 0;
top: 0;
transition: 1s ease-out;
}
.menu-icon {
display: block;
width: 25px;
margin: 40px auto;
cursor: pointer;
}
.menu .menu-btn:checked ~ .side-bar {
width: 100px;
height: 100vh;
}
This code posted is how I would like it to be first, but it didn’t work, obviously.
awesome bro!!! worked perfectly, mto thanks for the help!
– Cauã Mattos
Arrange @Cauãmattos I’m glad you were able to solve and I’m happy to help.
– Igor Bezerra