gpt4 book ai didi

CSS Div within Div full width and full height,相对于彼此

转载 作者:行者123 更新时间:2023-11-28 03:41:02 26 4
gpt4 key购买 nike

我正在尝试构建以下布局:

+-----------------------------------+
| |
+-----------------------------------+
+-----------------------------------+
| +-------------------------------+ |
| | | |
| +-------------------------------+ |
| +-----+ +-------------+ +------+ |
| | | | +---------+ | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | +---------+ | | | |
| | | | +---+ +---+ | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | +---+ +---+ | | | |
| +-----+ +-------------+ +------+ |
+-----------------------------------+

但由于某些原因,div 不会扩展到全宽或全高:http://jsfiddle.net/vmpgf/

有什么建议吗?

谢谢

最佳答案

好吧,这会让你非常接近,我对右边的 div 有一些问题,出于某种原因,它只适用于三个 div 的总宽度加起来达到 99% 的情况,所以我确信这不是“答案”,但会让你接近。

HTML -

<div id="divbanner">Top Banner</div>
<div id="container">
<div id="banner">
Banner
</div>
<div id="left">
Left
</div>
<div id="center">
<div id="centertop">
Center Top
</div>
<div id="centerleft">
Center Left
</div>
<div id="centerright">
Center Right
</div>
</div>
<div id="right">
Right
</div>
</div>

CSS -

#divbanner {
width: 100%;
background: #F45;
}
#container {
width: 100%;
background: #00C;
}
#banner {
width: 100%;
background: #778;
}
#left {
width: 30%;
background: #cc5;
display: inline-block;
}
#center {
width: 39%;
background: #cc7;
display: inline-block;
}
#right {
width: 30%;
background: #cc7;
display: inline-block;
}
#centertop {
width: 100%;
background: #445;
}
#centerleft {
width: 50%;
background: #c62;
float: left;
}
#centerright {
width: 50%;
background: #062;
float: right;
}​

在这里试试:http://jsfiddle.net/tyDq5/

关于CSS Div within Div full width and full height,相对于彼此,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11021048/

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