background-image
- это SVG
, поэтому я рекомендую вам использовать stroke="currentcolor"
, но только если вам абсолютно необходимо разобраться с этой ситуацией, вы можете обмануть его, используя drop-shadow() и translate () добавьте это к своему коду:
.carousel-control-next, .carousel-control-prev {
overflow: hidden;
opacity: .99!important;
}
.carousel-control-prev-icon{
filter: drop-shadow(32px 0px 0px red);
transform: translate(-32px, 0px);
}
.carousel-control-next-icon{
filter: drop-shadow(-32px 0px 0px red);
transform: translate(32px, 0px);
}
, если вы говорите только о непрозрачности, добавьте только это:
.carousel-control-next, .carousel-control-prev {
opacity: .99!important;
}
вот демка
.container {
padding: 15rem;
}
.wrapper {
background-color: pink;
width: 20rem;
margin: 0 auto;
}
.carousel-inner {
min-height: 150px;
}
.carousel-item {
margin-block-start: 3.5rem;
}
p {
text-align: center;
margin: 0 2rem;
}
.carousel-indicators {
display: none !important;
}
.carousel-icon {
height: 20%;
width: 20%;
margin-bottom: 1rem;
}
.carousel-icon:link,
.carousel-icon:visited,
.carousel-icon:hover,
.carousel-icon:active, {
/* color: red; */
/* background-color: red; */
background: red;
}
.carousel-control-next, .carousel-control-prev {
overflow: hidden;
opacity: .99!important;
}
.carousel-control-prev-icon{
filter: drop-shadow(32px 0px 0px red);
transform: translate(-32px, 0px);
}
.carousel-control-next-icon{
filter: drop-shadow(-32px 0px 0px red);
transform: translate(32px, 0px);
}
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Carousel</title>
<link rel="stylesheet" type="text/css" href="style-carousel.css">
<link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"integrity = "sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin = "anonymous">
</head>
<body>
<!-- jQuery Library -->
<script src = "https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity = "sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin = "anonymous">
</script>
<!-- Popper -->
<script src = "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity = "sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin = "anonymous">
</script>
<!-- Compiled and Minified Bootstrap JavaScript -->
<script src = "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity = "sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin = "anonymous">
</script>
<div class="container">
<div class="wrapper">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="myCarousel" data-slide-to="0" class="active"></li>
<li data-target="myCarousel" data-slide-to="1"></li>
<li data-target="myCarousel" data-slide-to="2"></li>
<li data-target="myCarousel" data-slide-to="3"></li>
<li data-target="myCarousel" data-slide-to="4"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<p>"Lorem ipsum dolor sit amet."</p>
</div>
<div class="carousel-item">
<p>"In ornare quam viverra orci sagittis eu volutpat odio facilisis."</p>
</div>
<div class="carousel-item">
<p>"Ullamcorper dignissim cras tincidunt lobortis."</p>
</div>
<div class="carousel-item">
<p>"Sed velit dignissim sodales."</p>
</div>
</div>
<a class="carousel-control-prev" href="#myCarousel" data-slide="prev">
<span class="carousel-control-prev-icon carousel-icon"></span>
</a>
<a class="carousel-control-next" href="#myCarousel" data-slide="next">
<span class="carousel-control-next-icon carousel-icon"></span>
</a>
</div>
</div>
</div>
</body>
</html>