Css 将div height设置为100%
我有4个div的位置像在图片中看到的那样。Div1、Div 2和Div 3放在页脚Div中。3个Div的内容是动态的,我不知道它们需要什么高度。如何将这3个div的高度设置为相同的值? 我已经尝试过不同的解决方案,比如将top和button设置为0px,正如这里提到的:Css 将div height设置为100%,css,html,Css,Html,我有4个div的位置像在图片中看到的那样。Div1、Div 2和Div 3放在页脚Div中。3个Div的内容是动态的,我不知道它们需要什么高度。如何将这3个div的高度设置为相同的值? 我已经尝试过不同的解决方案,比如将top和button设置为0px,正如这里提到的: 这就是我目前拥有的: 这是我的HTML布局: <div class="About"> <div class="RightAbout"> </div> <div class="Cent
这就是我目前拥有的: 这是我的HTML布局:
<div class="About">
<div class="RightAbout">
</div>
<div class="CenterAbout">
</div>
<div class="LeftAbout">
</div>
</div>
像这样
css
body, html {
height: 100%;
}
.About
{
padding:0px;
background-color:#757575;
border:none;
min-height:250px;
color:White;
font-size:12pt;
display:table;
}
.RightAbout
{
display:table-cell;
width:290px;
min-height:100%;
border-left:solid 1px #CDCDCD;
margin:0px 0px 0px 0px;
padding:0px 5px 0px 5px;
vertical-align:top;
background-color:blue;
}
.CenterAbout
{
display:table-cell;
width:290px;
min-height:100%;
border-left:solid 1px #CDCDCD;
vertical-align:top;
background-color:#757575;
}
.LeftAbout {
display:table-cell;
min-height:100%;
border: none;
width:290px;
vertical-align: top;
background-color:#757575;
}
像这样
css
body, html {
height: 100%;
}
.About
{
padding:0px;
background-color:#757575;
border:none;
min-height:250px;
color:White;
font-size:12pt;
display:table;
}
.RightAbout
{
display:table-cell;
width:290px;
min-height:100%;
border-left:solid 1px #CDCDCD;
margin:0px 0px 0px 0px;
padding:0px 5px 0px 5px;
vertical-align:top;
background-color:blue;
}
.CenterAbout
{
display:table-cell;
width:290px;
min-height:100%;
border-left:solid 1px #CDCDCD;
vertical-align:top;
background-color:#757575;
}
.LeftAbout {
display:table-cell;
min-height:100%;
border: none;
width:290px;
vertical-align: top;
background-color:#757575;
}
你似乎和这个人有同样的问题: 这将解决您的问题,并有助于将来解决类似问题:
你似乎和这个人有同样的问题: 这将解决您的问题,并有助于将来解决类似问题:
为什么您需要相同的高度?为什么你需要有相同的高度?