当 div 的最小高度为 100% 时,如何预定义其高度
请参阅下面的 html:
<head runat="server">
<title></title>
<style type="text/css">
html, body
{
padding: 0;
margin: 0;
width: 100%;
height: 100%;
border: 1px solid red;
}
#MainDiv
{
width: 100%;
min-height: 100%;
border: 1px solid blue;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div id="MainDiv">
Contents - A Repeater That Will Grow From Code Behind
</div>
</form>
</body>
</html>
我怎样才能有高度 ->开始时 MainDiv 为 800 像素(低内容)?
并在内容增加时强制其高度增加!
提前致谢
plz see the below html :
<head runat="server">
<title></title>
<style type="text/css">
html, body
{
padding: 0;
margin: 0;
width: 100%;
height: 100%;
border: 1px solid red;
}
#MainDiv
{
width: 100%;
min-height: 100%;
border: 1px solid blue;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div id="MainDiv">
Contents - A Repeater That Will Grow From Code Behind
</div>
</form>
</body>
</html>
how can i have height -> 800px for MainDiv At Start(Low Content)?
and force it's height to increase when contents are growed!
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果有帮助请告诉我。
Let me know if it helps.
像这样写
你上面评论的答案
如果你想要
html & body 100%
height 然后就这样写write like this
Answer of your above comment
If you want
html & body 100%
height then just write like this