图像不溢出:隐藏

时间:2016-04-01 05:08:23

标签: jquery html css

我需要让我的图像溢出每个幻灯片,但它没有溢出

* {
  margin:0;
  padding:0;
}
#slider {
  position:relative;
}
.owl-carousel .images {
  overflow:hidden;
   min-width:960px;
  width:100%;
  height:200px;
}
.owl-carousel img {
  width:100%;
  height:auto;
  }
<div id="slider">
  <div class="owl-carousel">
    <div class="images">
       <img src="http://tympanus.net/Tutorials/FullscreenSlitSlider/images/1.jpg" alt="">
         <img src="http://tympanus.net/Tutorials/FullscreenSlitSlider/images/2.jpg" alt="">
           <img src="http://tympanus.net/Tutorials/FullscreenSlitSlider/images/3.jpg" alt="">
             <img src="http://tympanus.net/Tutorials/FullscreenSlitSlider/images/4.jpg" alt="">
    </div>
  </div>
  </div>

任何人都建议我使用幻灯片显示的一些代码来运行自动

3 个答案:

答案 0 :(得分:0)

你有一个错字:

.owl-carousel .images {
  overflow:hidden
  min-width:960px;

添加分号:

.owl-carousel .images {
  overflow:hidden;
  min-width:960px;

答案 1 :(得分:0)

它不是一个小的mistek分号,

* {
  margin:0;
  padding:0;
}
#slider {
  position:relative;
}
.owl-carousel .images {
  overflow:hidden;
   min-width:960px;
  width:100%;
  height:200px;
}
.owl-carousel img {
  width:100%;
  height:auto;
  }
<div id="slider">
  <div class="owl-carousel">
    <div class="images">
       <img src="http://tympanus.net/Tutorials/FullscreenSlitSlider/images/1.jpg" alt="">
         <img src="http://tympanus.net/Tutorials/FullscreenSlitSlider/images/2.jpg" alt="">
           <img src="http://tympanus.net/Tutorials/FullscreenSlitSlider/images/3.jpg" alt="">
             <img src="http://tympanus.net/Tutorials/FullscreenSlitSlider/images/4.jpg" alt="">
    </div>
  </div>
  </div>

答案 2 :(得分:0)

这个怎么样:

* {
  margin:0;
  padding:0;
}
#slider {
  position:relative;
}
.owl-carousel .images {
 
   min-width:960px;
  width:100%;
  height:200px;
}
.owl-carousel img {
position:absolute;
  top:0;
  left:0;
  width:100%;
  height:auto;
  }
<div id="slider">
  <div class="owl-carousel">
    <div class="images">
       <img src="http://tympanus.net/Tutorials/FullscreenSlitSlider/images/1.jpg" alt="">
         <img src="http://tympanus.net/Tutorials/FullscreenSlitSlider/images/2.jpg" alt="">
           <img src="http://tympanus.net/Tutorials/FullscreenSlitSlider/images/3.jpg" alt="">
             <img src="http://tympanus.net/Tutorials/FullscreenSlitSlider/images/4.jpg" alt="">
    </div>
  </div>
  </div>