-3
People appreciate if anyone can help me, I’m starting the course now and I don’t have much experience yet. I’m doing a job and I have a slide with three images that need to run as carousel and with buttons (previous and next). As in the code below I managed to do similar, but with Type radio buttons. wanted to replace the radios by two buttons at the ends with ">" for next and "<" for previous. and the carousel function I could not do.
HTML
<li>
<input type="radio" id="slide1" name="slide" checked>
<label for="slide1"></label>
<img src="imgs/1.jpg" />
</li>
<li>
<input type="radio" id="slide2" name="slide">
<label for="slide2"></label>
<img src="imgs/2.jpg" />
</li>
<li>
<input type="radio" id="slide3" name="slide">
<label for="slide3"></label>
<img src="imgs/3.jpg" style="
height: 400px;">
</li>
</ul>
CSS
```* { margin: 0 auto; padding: 0 auto; }
.slider {
display: block;
height: 400px;
width: 600px;
margin: auto;
margin-top: 20px;
position: relative;
}
.slider li {
list-style: none;
position: absolute;
}
.slider img {
margin: auto;
height: 100%;
width: 100%;
vertical-align: top;
}
.slider input {
display: none;
}
.slider label {
background-color: #000;
bottom: 5px;
cursor: pointer;
display: block;
height: 10px;
position: absolute;
width: 10px;
z-index: 10;
}
.slider li:nth-child(1) label {
left: 10px;
}
.slider li:nth-child(2) label {
left: 40px;
}
.slider li:nth-child(3) label {
left: 70px;
}
.slider img {
opacity: 0;
visibility: hidden;
}
.slider li input:checked ~ img {
opacity: 1;
visibility: visible;
z-index: 10;
}
pessoal que puder dar uma opinião eu agradeço muito... Abraços
Thank you very much guy worked here, but only appears the first image the others are blank.
– Vittor Caggiano