【问题标题】:how to increase the width of the images如何增加图片的宽度
【发布时间】:2015-02-23 20:17:52
【问题描述】:

您好,在下面的代码中,如何增加图像的宽度以及如何删除显示白色边框的滑块 div 的边框我想删除边框。 通过使用 javascript,我以幻灯片格式显示图像,但它并没有增加宽度。以及我想删除 img 边框。

html

<div id="sliders1">
      <div id="slider">
      <div class="gallery">
        <ul class="images">
          <li class="show"><img width="950" height="300" src="img/1.jpg" alt="photo_one" /></li>
          <li><img width="950" height="300" src="img/2.jpg" alt="seascape" /></li>
          <li><img width="950" height="300" src="img/3.jpg" alt="seascape" /></li>
          <li><img width="950" height="300" src="img/4.jpg" alt="seascape" /></li>
          <li><img width="950" height="300" src="img/5.jpg" alt="seascape" /></li>
          <li><img width="950" height="300" src="img/6.jpg" alt="seascape" /></li>
        </ul>
      </div>
     </div>
     </div>

css

#slider {   
  width: 950px;
  overflow: hidden;
  margin: 0px auto 0 auto;
  padding: 15px 0 15px 0;
} 
ul.images {
  width:1050px;
  height:300px;
  overflow:hidden;
  position:relative;
  margin:0;
  padding:0;

} 
#sliders1{
    background-color:#00008B;
}
ul.images li {
  position:absolute;
  margin:0;
  padding:0;
  left:0;
  right:0;
  list-style:none;
}

ul.images li.show {
  z-index:500;  
}

ul img {
  border:none;  
}

js

    <script type="text/javascript" src="js/modernizr-1.5.min.js"></script>

<script type="text/javascript">
    $(document).ready(function() {
      $('ul.sf-menu').sooperfish();
    });
  </script>

【问题讨论】:

  • @mplungjan 抱歉,它是 950 像素
  • 请贴出你正在使用的JS。
  • @JoeCorby 查看我的 js 文件
  • 你确定没有更多的JS吗?我猜你在使用 jquery.sooperfish.js
  • @JoeCorby 是的,我正在使用那个库

标签: jquery html css


【解决方案1】:

对于滑块的边框,modernizr 为 body 元素添加了边距。添加

body {
    margin: 0;
}

应该足以解决您的问题。

我不明白你想对这些图片做什么。

【讨论】:

  • 不明白如何给出答案
  • 滑块有一个问题,图像有一个问题,不是吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-09-01
  • 1970-01-01
  • 2022-01-20
  • 2018-12-02
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多