Why is my css below not working for me? Can someone advise me, please.
#slide1:checked ~ #inner { margin-left: 0;}
#slide2:checked ~ #inner { margin-left: -800px;}
#slide3:checked ~ #inner { margin-left: -1600px;}
Below is the css below. I don’t know where to go from here.
#slide1:checked ~
#slide2:checked ~
#slide3:checked ~
background: #333;
border-color: #333; !important;
}
HTML:
<div id="broadcast">
<div id="overflow">
<div id="inner">
<article>
<div class="info"></div>
<div id="pic1"></div>
</article>
<article>
<div class="info"></div>
<div id="pic2"></div>
</article>
<article>
<div class="info"></div>
<div id="pic3"></div>
</article>
</div>
</div>
</div>
<input checked type="radio" name="slider" id="slide1">
<input type="radio" name="slider" id="slide2">
<input type="radio" name="slider" id="slide3">
<div id="broadControl">
<label for="slide1"></label>
<label for="slide2"></label>
<label for="slide3"></label>
</div>
I am trying to make a slide transition with pure CSS in order to understand CSS more.
But I’ve been stuck here for 3 days.
I have no idea why this is not working.
If you have any ideas, offer them to me.
Thanks in advance.
source
share