Html 内分区高度

Html 内分区高度,html,css,Html,Css,我有一个容器,有100%的高度和它的工作伟大 我希望客户端内容将达到80% 我希望是这样 这是我的网页HTML和CSS CSS HTML 请提出任何建议?添加#Clientcontent{height:80%}您只需将垂直对齐置于顶部即可。把它放在#ClientContent上。我不确定这是否是真正缺少的。尝试添加最大高度:80%。像这样: #ClientContent { max-height:80%; vertical-align:top; min-height: 80%; borde

我有一个容器,有100%的高度和它的工作伟大

我希望客户端内容将达到80%
我希望是这样

这是我的网页HTML和CSS

CSS

HTML



请提出任何建议?

添加
#Clientcontent{height:80%}
您只需将垂直对齐置于顶部即可。把它放在#ClientContent上。我不确定这是否是真正缺少的。尝试添加最大高度:80%。像这样:

#ClientContent
{
max-height:80%;
vertical-align:top;
min-height: 80%;
border-color: #36A9E9;
border-width: thin;
border-style: solid;
width: 100%;
margin: 0 auto;
background-color: ThreeDFace;
}
这似乎有效


您在哪个浏览器上遇到此问题?您可以将div绝对
定位到
#container
表单中,就像@SwDevMan81所做的那样。您的clientContent元素是什么?是潜水艇吗?跨度?一个p?
<body>

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

<div id="ClientContent">

</div>
</form>
</body>
#ClientContent
{
max-height:80%;
vertical-align:top;
min-height: 80%;
border-color: #36A9E9;
border-width: thin;
border-style: solid;
width: 100%;
margin: 0 auto;
background-color: ThreeDFace;
}
*
{
    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;
}