【发布时间】: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;
}
以及页面链接:
【问题讨论】:
-
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