gpt4 book ai didi

html - CSS 表格单元格 100% 宽度

转载 作者:太空宇宙 更新时间:2023-11-04 14:10:20 25 4
gpt4 key购买 nike

我正在尝试创建这样的布局:

layout

这是我目前所拥有的:

HTML

<div id="wrapper">
<div id="top">
<div id="top">100% width and 45px height </div>
</div>
<div id="middle">
<div id="middleleft">Middle Left 20%</div>
<div id="middlecenter">Center 60%</div>
<div id="middleright">Middle Right 20%</div>
</div>
<div id="bottom">
<div id="bottom">100% width and 30% height</div>
</div>

CSS

#top{
width:???;
height: 45px;
}
#bottom {
width: ???;
height: 30%;
}

http://jsfiddle.net/Jn6x6/

但我不能让顶部和底部占 100%。

这是正确的方法还是我应该尝试不同的方法?

谢谢。

最佳答案

添加

#wrapper #middle {
display:table;
width: 100%;
height: 100%;
}

到你的 JsFiddle 的 CSS。

参见 http://jsfiddle.net/Jn6x6/1/

关于html - CSS 表格单元格 100% 宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20815700/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com