多个 div 内的 div x 无法扩展其以 % 指定的高度?

发布于 2024-10-13 03:55:23 字数 996 浏览 2 评论 0原文

我有一个侧边栏,有许多嵌套的 div 来放置我的圆角。但是当我尝试将内容的 div 高度设置为 90% 时,它没有扩展。问题是什么。我的 html,主体有 100% 高度。我的 div 嵌套是有些像这样。

<body>
<div class="main">                //it contains header n content div,its height is 90%
<div class="header"></div>        //its height is 10% of main div
<div class="content">             //its height is 90% of main div

<div class="vertical_navigation"> //its height is 99% of content div

<div><div><div><div>              //thses divs are for rounded corner image concept
<div> </div>                      //this div contains the data.now its height is 80% but its not expanding?h
                                  //i cant use min-height,its not working too.how to give height referenced to                                //vertical navi div??
</div></div></div></div>

</div>

</div>

</div>
<footer></footer>
</body>

i have a sidebar having many nested divs to place my rounded corrners.but when i tried to set the content's div height equal to 90% its not expanding.what is the issue.my html,body have 100% height.my div nest is some what like this.

<body>
<div class="main">                //it contains header n content div,its height is 90%
<div class="header"></div>        //its height is 10% of main div
<div class="content">             //its height is 90% of main div

<div class="vertical_navigation"> //its height is 99% of content div

<div><div><div><div>              //thses divs are for rounded corner image concept
<div> </div>                      //this div contains the data.now its height is 80% but its not expanding?h
                                  //i cant use min-height,its not working too.how to give height referenced to                                //vertical navi div??
</div></div></div></div>

</div>

</div>

</div>
<footer></footer>
</body>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

洋洋洒洒 2024-10-20 03:55:23

您是否考虑过仅使用 css 应用圆角而不担心 ieretards 没有它们?

have you considered applying rounded corners with just css and not worrying about the ieretards not having them?

昨迟人 2024-10-20 03:55:23

当有这么多嵌套的div时,最好考虑DIV的宽度和高度的测量,如果容器div小于其内部的div,它就不会拉伸,因为这样,浏览器无法检测到多远div 是用来拉伸的。为了解决这个问题,请正确使用CSS。

When having so much nested div, it's good you consider the measurement in width and height of the DIV if the container div is lesser that the ones inside it, it won't stretch,because that way, the browser can't detect how far the div is meant to stretch. to resolve this use make proper use of CSS.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文