I'm trying to change the indicators color when a slide is active. So when you click the indicators the slide change, but the indicators doesn't change color. I only set the .bar:hover with a border color of white. I also tried :active :checked but nothing works... but I can't figure out how to do this.
CAROUSEL HTML:
<div class="slidershow center">
<div class="slides">
<input type="radio" name="r" id="r1" checked>
<input type="radio" name="r" id="r2">
<input type="radio" name="r" id="r3">
<input type="radio" name="r" id="r4">
<input type="radio" name="r" id="r5">
<input type="radio" name="r" id="r6">
<input type="radio" name="r" id="r7">
<div class="slida s1 img-magnifier-container">
<img id="myimage" src="carousel/01.png">
</div>
<div class="slida img-magnifier-container">
<img id="myimage2" src="carousel/02.png" alt="">
</div>
<div class="slida img-magnifier-container">
<img id="myimage3" src="carousel/03.png" alt="">
</div>
<div class="slida img-magnifier-container">
<img id="myimage4" src="carousel/04.png" alt="">
</div>
<div class="slida img-magnifier-container">
<img id="myimage5" src="carousel/05.png" alt="">
</div>
<div class="slida img-magnifier-container">
<img id="myimage6" src="carousel/06.png" alt="">
</div>
<div class="slida img-magnifier-container">
<img id="myimage7" src="carousel/07.png" alt="">
</div>
</div>
<div class="navigation">
<label for="r1" class="bar"></label>
<label for="r2" class="bar"></label>
<label for="r3" class="bar"></label>
<label for="r4" class="bar"></label>
<label for="r5" class="bar"></label>
<label for="r6" class="bar"></label>
<label for="r7" class="bar"></label>
</div>
</div>
CAROUSEL CSS:
.slidershow {
width: 100%;
height: 100%;
overflow: hidden;
}
.center {
transform: translate (-50% , -50%);
}
.navigation {
position: relative;
bottom: 0;
left: 32%;
transform: translateX (-50%);
display: flex;
z-index: 999;
}
@media screen and (max-width: 768px) {
.slidershow {
display: none;
}
}
.bar {
width: 50px;
height: 1px;
border: 2px solid grey;
margin: 6px;
cursor: pointer;
transition: 0.4s;
}
.bar:hover {
border-color: white;
}
input[name="r"]{
position: absolute;
visibility: hidden;
}
.slides {
width: 1000%;
height: 100%;
display: flex;
}
.slida {
width: 10%;
transition: 0.6s;
}
.slida img {
width: 100%;
height: 100%;
}
#r1:checked ~ .s1 {
margin-left: 0;
}
#r2:checked ~ .s1 {
margin-left: -10%;
}
#r3:checked ~ .s1 {
margin-left: -20%;
}
#r4:checked ~ .s1 {
margin-left: -30%;
}
#r5:checked ~ .s1 {
margin-left: -40%;
}
#r6:checked ~ .s1 {
margin-left: -50%;
}
#r7:checked ~ .s1 {
margin-left: -60%;
}
.carousel img {
width: 100%;
}