我有这个网站:HTML教程流动布局不工作
<div class="template">
<div class="template-header"></div>
<div class="template-navigation"></div>
<div class="template-content">
<div class="template-content-left"></div>
<div class="template-content-middle"></div>
<div class="template-content-right"></div>
</div>
<div class="template-footer"></div>
</div>
使用这个CSS:
*
{
margin: 0;
padding: 0;
}
body, html
{
height: 100%;
min-height: 100%;
}
.template
{
height: 100%;
}
.template-header
{
background: gray;
height: 100px;
}
.template-navigation
{
background: blue;
height: 50px;
}
.template-content
{
height: calc(100% - 200px);
}
.template-content-left
{
float: left;
background: black;
height: 100%;
width: 200px;
}
.template-content-middle
{
background: magenta;
height: 100%;
float: left;
width: calc(100% - 400px);
}
.template-content-right
{
float: right;
background: black;
height: 100%;
width: 200px;
}
.template-footer
{
background: blue;
height: 50px;
}
我不能让template-content
以填补剩余的高度,我不能让template-content-middle
填充剩余的宽度。
以下必须固定高度: 模板头 模板导航 模板尺
以下必须固定宽度: 模板内容左 模板内容右
寻找跨浏览器的解决方案。如果可能的话,想避免使用javascript/jquery。
任何帮助,将不胜感激。
'高度:如果父母的身高为100%(这适用于相对和静态),那么父母具有100%的身份,如果父母的身体/ html标记必须具有100%,那么100%适用。所以在你的情况下,这不会是一个好主意,所以你应该使用javascript并计算高度以应用它。 – drip
我确实有HTML,身高设置为100%。 – c0D3l0g1c