[英]CSS overflow:hidden is not working
I was tryed to create a slider and the slider is working but only one part is not working . 我试图创建一个滑块,但该滑块正在工作,但是只有一部分无法工作。
"
overflow:hidden
" This part is not working“
overflow:hidden
” 这部分不起作用
Please tell me what is issue on my code . 请告诉我我的代码有什么问题。 I will update this part .
我将更新这一部分。
This is my HTML: 这是我的HTML:
<!-- Slider --><div class="slider-main">
<!-- <div class="container site-test_1"> -->
<img id="slider-imge1" class="img-responsive" src="images/slider-images/slide_image-001.jpg" alt="Please wait..."/>
<img id="slider-imge2" class="img-responsive" src="images/slider-images/slide_image-002.jpg" alt="Please wait..."/>
<img id="slider-imge3" class="img-responsive" src="images/slider-images/slide_image-003.jpg" alt="Please wait..."/>
<img id="slider-imge4" class="img-responsive" src="images/slider-images/slide_image-004.jpg" alt="Please wait..."/>
<img id="slider-imge5" class="img-responsive" src="images/slider-images/slide_image-005.jpg" alt="Please wait..."/>
<!-- </div> -->
</div> <!-- End Slider -->
This is my CSS part: 这是我的CSS部分:
.slider-main{
width:100%;
/* height:505px; */
height:auto;
overflow:hidden !important;
position:relative;
z-index:1;
}
.slider-main img{
width:100%;
max-height:500px;
overflow:hidden !important;
}
Try putting the max-height: 500px
on the .slider-main
instead: 尝试将
max-height: 500px
放在.slider-main
:
.slider-main {
max-height: 500px;
}
I think Your max-height is bigger than slider-main div. 我认为您的最大高度大于Slider-main div。
Read details: http://www.w3schools.com/cssref/pr_pos_overflow.asp 阅读详细信息: http : //www.w3schools.com/cssref/pr_pos_overflow.asp
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.