html - 内部div高度CSS

标签 html css

我有一个 100% 高度的容器,效果很好

我希望客户端内容为 80%
我希望它像这样

Example http://img545.imageshack.us/img545/2822/exmapler.png

这是我的页面 HTML 和 CSS

CSS

*
{
    padding: 0;
    margin: 0;
}
html, body
{
    height: 100%;
}

#container
{
    min-height: 99%;
    border-color: #36A9E9;
    border-width: thin;
    border-style: solid;
    width: 85%;
    margin: 0 auto;
    background-color: ThreeDFace;
}
* html #container
{
    height: 100%;
}
#ClientContent
{
    min-height: 80%;
    border-color: #36A9E9;
    border-width: thin;
    border-style: solid;
    width: 100%;
    margin: 0 auto;
    background-color: ThreeDFace;
}

HTML

<body>

<form id="container" runat="server">

<div id="ClientContent">

</div>
</form>
</body>

请提出任何想法?

最佳答案

这似乎有效 here

*
{
    padding: 0;
    margin: 0;
}
html, body
{
    height: 100%;
}
#container
{
    position: relative;
    min-height: 99%;
    border-color: #36A9E9;
    border-width: thin;
    border-style: solid;
    width: 85%;
    margin: 0 auto;
    background-color: ThreeDFace;
}
* html #container
{
    height: 100%;
}
#ClientContent
{
    position: absolute;
    height: 80%;
    border-color: #36A9E9;
    border-width: thin;
    border-style: solid;
    width: 99.6%;
    margin: 0 auto;
    background-color: ThreeDFace;
}

关于html - 内部div高度CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6097740/

相关文章:

html - 在网站上嵌入 3D 模型

php - 使用 echo 输出 HTML 在 PHP 中被认为是不好的做法?

javascript - 如何从下拉列表中删除不需要的选项值?

html - 在 CSS 中更改嵌入式 youtube 视频的位置

html - 屏幕上的分页符(css 多列布局)

javascript - 为什么我的输入接受所有值,即使我使用函数来防止这种情况发生?

html - 使用 CSS 根据其标题设置 HTML 元素的样式

jquery - 为可拖动元素设置边界

javascript - 将文本大小更改为不超过表单输入的宽度

javascript - 地理定位 - 检查某个位置是否属于某个区域