I have been attempting to create a carousel with the control arrows positioned outside of it, but I am encountering difficulty getting the arrows to display correctly. When I place the controls code outside the carousel, they function as intended but do not align properly on the sides of the carousel.
Below is the HTML code for the controls:
<a class="carousel-control-prev" href="#carouselControles" role="button" data-slide="prev">
<span class="icon-prev bi bi-chevron-left font-mainColor-s1" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselControles" role="button" data-slide="next">
<span class="icon-next bi bi-chevron-right font-mainColor-s1" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
Here is the CSS code:
#myCarousel {
margin-left: 50px;
margin-right: 50px;
}
.carousel-control {
top: 50%;
margin: 50px;
}
.carousel-control-prev {
margin-left: -25px;
}
.carousel-control.next {
margin-right: -25px;
}
This is the desired layout:
Your assistance is greatly appreciated. Thank you.