小编MR.*_*now的帖子

div中的图像不显示

我有问题,DIV内的照片没有显示.由于我使用的是砌体网格,而网站就像是Pinterest,我不想限制图像或内部的高度,所以我把auto,但是当我把auto,或100%,图像没有显示时,我的代码在下面.

.inner {
    background-color: rgb(255, 255, 255);
    padding-bottom: 40px;
    height:auto;
    position: relative;
    overflow: hidden;
    border: 2px solid #ECECEC;
    margin-bottom: 30px;
}

.image-box {
	position:relative;
   height: auto;
    width: 100%;
    padding-right: 0px;
    padding-left: 0px;
    background-position: center;
    background-color: #4D4E56;
}

.image-box .img{
	width: 100%;
    display: block;
   float: left;
	background-repeat: no-repeat;
    background-size: cover;
	
}
Run Code Online (Sandbox Code Playgroud)
<div class="inner">
  <a href="{{ link }}"><div class="image-box" style="background-image:url(http://placehold.it/350x550)"></div></a>

</div>
Run Code Online (Sandbox Code Playgroud)

html css css3

0
推荐指数
1
解决办法
2999
查看次数

标签 统计

css ×1

css3 ×1

html ×1