我创建了一个轮播,我想在轮播项目上添加 box-shadow 属性。这是不可能的,因为轮播的溢出:隐藏属性。
有没有办法克服它?
*由于某种原因,Carousel 无法正常工作,但您仍然可以看到 css 问题
HTML:
<div class="container">
<div class="row">
<div class="col-xs-12">
<div id="myCarousel" class="carousel slide" data-interval="false">
<!-- Carousel items -->
<div class="carousel-inner">
<div class="item active">
<div class="row">
<div class="col-xs-4 product-item"> <a href="#"><img src="http://lopezmarine.com/wp-content/uploads/2013/09/500x500-490x490.gif" width="500" height="500" alt=""></a>
<h4><a href="#">Product Name</a></h4>
<div class="price">€ 25.00</div>
</div>
<div class="col-xs-4 product-item"> <a href="#"><img src="http://lopezmarine.com/wp-content/uploads/2013/09/500x500-490x490.gif" width="500" height="500" alt=""></a>
<h4><a href="#">Product Name</a></h4>
<div class="price">€ 25.00</div>
</div>
<div class="col-xs-4 product-item"> <a href="#"><img src="http://lopezmarine.com/wp-content/uploads/2013/09/500x500-490x490.gif" width="500" height="500" alt=""></a>
<h4><a href="#">Product Name</a></h4>
<div class="price">€ 25.00</div>
</div>
</div>
<!--/row-->
</div>
<!--/item-->
<div class="item">
<div class="row">
<div class="col-xs-4 product-item"> <a href="#"><img src="http://lopezmarine.com/wp-content/uploads/2013/09/500x500-490x490.gif" width="500" height="500" alt=""></a>
<h4><a href="#">Product Name</a></h4>
<div class="price">€ 63.00</div>
</div>
<div class="col-xs-4 product-item"> <a href="#"><img src="http://lopezmarine.com/wp-content/uploads/2013/09/500x500-490x490.gif" width="500" height="500" alt=""></a>
<h4><a href="#">Product Name</a></h4>
<div class="price">€ 24.00</div>
</div>
<div class="col-xs-4 product-item"> <a href="#"><img src="http://lopezmarine.com/wp-content/uploads/2013/09/500x500-490x490.gif" width="500" height="500" alt=""></a>
Product Name</a>
</h4>
<div class="price">€ 25.00</div>
</div>
</div>
<!--/row-->
</div>
<!--/item-->
<div class="item">
<div class="row">
<div class="col-xs-4 product-item"> <a href="#"><img src="http://lopezmarine.com/wp-content/uploads/2013/09/500x500-490x490.gif" width="500" height="500" alt=""></a>
<h4><a href="#">Product Name</a></h4>
<div class="price">€ 42.00</div>
</div>
<div class="col-xs-4 product-item"> <a href="#"><img src="http://lopezmarine.com/wp-content/uploads/2013/09/500x500-490x490.gif" width="500" height="500" alt=""></a>
Product Name</a>
</h4>
<div class="price">€ 25.00</div>
</div>
<div class="col-xs-4 product-item"> <a href="#"><img src="http://lopezmarine.com/wp-content/uploads/2013/09/500x500-490x490.gif" width="500" height="500" alt=""></a>
<h4><a href="#">Product Name</a></h4>
<div class="price">€ 54.00</div>
</div>
</div>
<!--/row-->
</div>
<!--/item-->
</div>
<!--/carousel-inner-->
<div class="carousel-nav"> <a class="carousel-control prev" href="#myCarousel" data-slide="prev"></a>
<a class="carousel-control next" href="#myCarousel" data-slide="next"></a>
</div>
</div>
<!--/myCarousel-->
</div>
</div>
</div>
css(我没有在这里发布完整的 css 代码,因为它不可读,这里是关于这个问题的最重要的样式):
.product-item {
position: relative;
padding-top: 20px;
}
.product-item:hover {
-webkit-box-shadow: 0px 3px 13px 0px rgba(50, 50, 50, 0.5);
-moz-box-shadow: 0px 3px 13px 0px rgba(50, 50, 50, 0.5);
box-shadow: 0px 3px 13px 0px rgba(50, 50, 50, 0.5);
z-index: 100;
}
JAVASCRIPT
jQuery('.carousel').each(function () {
jQuery(this).carousel({
interval: false
});
});