css - BOOTSTRAP CSS 照片墙覆盖页面

标签 css twitter-bootstrap

我试图用小照片覆盖整个页面,但我发现我不能,因为它们会在页面中留下一些左右边距。

我没有使用 js 来做这件事,只是 css 和 html:

<div class="container-fluid" id="wrapper">
<div id="home-decore">

<img/>
<img/>
<img/>
<img/>
<img/>
<img/>
<img/>
<img/>
<img/>
<img/>
<img/>
etc ..



</div>
</div>

#wrapper{
  background:red;
    padding-top:5%;
min-height: 88%;
height: auto !important;
height: 88%;

}
#home-decore{
margin:0;
padding-top:60px;
left:0;
top:0;
position:realtive;
min-height: 100%;
height: auto !important;
height: 100%;
background:#000;


}
#home-decore img{
  border-radius:2px;
  border:0.3% solid white;
  opacity:0.6;
  width: 3.3333%; 
    overflow: hidden;
}
#home-decore img:hover{
opacity:1;
}

我想要的是让所有页面都适合 right:0;top:0;bottom:0;left:0;

最佳答案

取水平方向的图像数量,然后将每个图像的宽度指定为 (100/numHorizo​​ntalImages)%,然后对高度执行相同的操作。如果你有 10 张水平图像和 5 张垂直图像,它看起来像这样:

img { 宽度:10%;高度:20%;

关于css - BOOTSTRAP CSS 照片墙覆盖页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12550411/

相关文章:

jquery - 为什么第二次打不开 Bootstrap 模式对话框?

jquery - Bootstrap glyphicons 在 IE11 的 Windows 10 中不显示

html - 使 2 个子元素占据相同的空间而不会折叠父元素

css - 无法在 f :facet 内的列标题上应用自定义样式

css - Firefox 17 滚动错误

css - 如何使用TFS在线编译SASS?

html - css3 3D 旋转在添加过渡时稍微移动到变换原点之外?

jquery - 如何使元素居中同时保持 Bootstrap 的大小?

html - 如何使 Bootstrap 跨越未使用的列?

html - 带有下拉菜单但可点击的 Bootstrap 4 导航栏