【问题标题】:Stretching an image拉伸图像
【发布时间】:2014-03-29 03:23:50
【问题描述】:

好的,所以我在滑块中有一个图像,但它不能正确缩放。

先小后拉长。我要一直拉长。如何实现?

看看截图(忽略第二张截图中的红色):

还有css:

.slider-wrapper { 
    width: 310px; 
    height: 580px;
      background: url("images/S4.png") center center ;
background-size: contain;
   background-repeat: no-repeat;        
}
.nivoSlider {
    position:relative;
    width:268px;
    height:474px;
    top:51px;
    bottom:0px;
    left:21px;
    right:23px;
    overflow: hidden;
}
.nivoSlider img {
    position:absolute;
    top:0px;
    left:0px;
    width:268px;
    height:474px;
}

以及页面链接:

http://oneapptheme.github.io

【问题讨论】:

  • background-size: 100% 100%;background-size: cover; 将完成这项工作
  • 不要使用background-size: 100% 100%;,会弄乱图片比例。请改用background-size: cover;
  • 背景尺寸:100% 100%;不工作
  • 你能提供这个页面的链接吗?
  • 给你@Dheeraj :oneapptheme.github.io

标签: html css image resize slider


【解决方案1】:

你可以试试这个:-

.nivoSlider3 img{height:100% !important;}

【讨论】:

    【解决方案2】:

    在图片的css文件中使用... 背景尺寸:100%;

    【讨论】:

      猜你喜欢
      • 2012-09-09
      • 1970-01-01
      • 1970-01-01
      • 2022-01-05
      • 2015-02-15
      • 2016-01-06
      • 2020-04-10
      • 2011-11-12
      相关资源
      最近更新 更多