我对 CSS 全屏布局做了相当多的研究,但我似乎无法找到我正在尝试做的事情。我正在寻找具有页眉、页脚、多列和侧边栏的全屏布局。这是一个 ascii 模型,然后是一个 photoshop 模型。有人有主意吗?我还没有找到可行的全屏布局技术。
+-----------------------+-------+
| | |
+-------------+---------+ +
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
+-------------+---------+-------+
| |
+-------------------------------+
那么请告诉我,您认为如何才能实现这一目标?我对 CSS 3 或 HTML 5 选项持开放态度,因为跨浏览器兼容性是一个好处,但不是必需的(WebKit 是目标平台)。
最佳答案
请在此处查看以下代码: http://jsfiddle.net/davinciwanab/nX4eq/
<style type="text/css">
* {
margin: 0px;
padding: 0px;
}
#header {
float: left;
width: 75%;
height: 20px;
background-color: #333;
}
#colRight {
float: right;
width: 25%;
height: 500px;
background-color: #CCC;
}
#content {
float: left;
width: 50%;
height: 480px;
background-color: #EEE;
}
#contentRight {
float: left;
width: 25%;
height: 480px;
background-color: #AAA;
}
#footer {
width: 100%;
height: 20px;
background-color: #777;
}
</style>
</head>
<body>
<div id="header"></div>
<div id="colRight"></div>
<div id="content"></div>
<div id="contentRight"></div>
<div style="clear:both;"></div>
<div id="footer"></div>
</body>
关于css - 全屏 CSS 布局挑战(带页眉和页脚的多列),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5837290/