为什么切换轮播时背景图片的大小会改变?

时间:2019-01-29 21:39:41

标签: html css debugging bootstrap-4

我想知道为什么var imagePicker = UIImagePickerController()imagePicker.delegate = selffunc openGallary() { imagePicker.sourceType = UIImagePickerControllerSourceType.photoLibrary imagePicker.allowsEditing = true self.present(imagePicker, animated: true, completion: nil) } 时会垂直变大。我希望它在切换所有图像时保持不变。

我在做什么错,我该如何解决?

代码段

background-image
url/path
url/path2

1 个答案:

答案 0 :(得分:1)

.topSession的高度为max-height:100%会根据图像的大小调整大小,因此您要做的是定义类的高度,例如:

.topSection {
 padding-top: 20px;
 background-image: url("https://d2d00szk9na1qq.cloudfront.net/Product/40a055c9-72b6-4e07-aaa8-0eaf956f297c/Images/Large_0348615.jpg");
 width: 100%;
 height: 60%;
 position: fixed;
}