<分区>
您好,我提供了我的 div 容器的图片,我试图说完全填充容器,如您所见,但我遇到了问题,即使我的 div 在表中并且等于其他 div 容器。它只是不会完全填满。
它应该是什么样子的边框等等。 what it should look like
<div class="cit">
<div class="column">
<h3>Register</h3>
<img class="cit2" src="images/cit2.jpg">
<h2 class="divfooter">Step 1 </h2>
</div>
</div>
html,body{
width: 100%;
height: 100%;
margin:0;
padding:0;
}
.cit {
display: table;
width: 90%;
}
.column {
display: table-cell;
padding: 30px;
overflow: none;
}
h3{
background: red;
height: 90%;
}
.cit2{
max-width: 100%;
max-height: 100%
}
.divfooter{
background: red;
}
最佳答案
它没有占据整个高度的原因是因为父对象很可能不是您想要的 100%。在容器样式之前放置以下代码:
html,body{
width: 100%;
height: 100%;
}
关于html - Div 容器 - 如何完全填充它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53768984/