【发布时间】:2018-02-09 05:38:20
【问题描述】:
我正在尝试使我的所有图像大小相同,每个图像之间有一点填充/空间。我使用的代码似乎不起作用,图像保持原来的大小(并且都是不同的大小)。
CSS
.gallery {
position: relative;
float: left;
width: 100px;
height: 100px;
background-position: 50% 50%;
background-repeat: no-repeat;
background-size: cover;
padding: 5%;
}
HTML
<form id="Form1" method="post" role="form" enctype="multipart/form-data">
<label>
<input type="text" id="albumname" name="albumname" class="form-control" placeholder="Album Name" required autofocus>
</label>
<div class="input-group">
<label for="file-upload" class="custom-file-upload">
<i class="fa fa-cloud-upload"></i> Choose Files...
</label>
<input id="file-upload" type="file" multiple/>
<button class="btn btn-lg btn-primary btn-block btn-signin-upload" type="submit">Upload</button>
</div>
<div class="gallery"></div>
</form>
有人知道这个问题吗?它用于在上传之前预览许多图像。
【问题讨论】:
-
“不工作”不是任何人都可以提供帮助的
-
你必须告诉我们确切的问题,图像发生了什么
-
能否请您在问题中包含 html?
-
@Abhijit 我添加了 html
-
您的 css 适用于
gallery类的元素,而不是您放入的任何图像。