gpt4 book ai didi

css - 需要 3 列 CSS 布局

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:37:58 26 4
gpt4 key购买 nike

查看布局 here ,我想将整个页面的最小宽度限制为 600px。我试过设置内容的最小宽度,但右侧与它重叠。

有人可以推荐一种更正此问题的方法,或满足此要求的其他布局吗?

在此要记住的另一件事是内容在代码中出现的顺序 - 1) 2) 3) 以及页面上显示的顺序。任何一列都应该能够将页脚向下移动,我想再定义两个区域:当前标题在代码中显示为 4),5) 是 4)< 上方的小内容栏/p>

简而言之,在代码中,页面内容区域将在页面上显示如下(从上到下排序,从 1 开始):

7) top menu
5) header
4) contentbar
2) 1) 3)
6) (footer)

谢谢。

更新

在 Midas 的帮助下,我几乎得到了我要找的东西。下面的问题是,当浏览器宽度减小时,右侧列不会将页脚向下移动,也不会锁定到最小宽度的位置。此外,我仍然无法将顶部菜单栏的所有内容都向下推,因为它只是与标题重叠:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Holygrail1</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<style type="text/css">
* {
margin:0; padding:0
}
body {
font:76% Arial, Helvetica, sans-serif
}
p {
margin:0 10px 10px
}
a {
display:block; color:#981793; padding:10px
}

#container
{
margin-top:104px; min-height:400px;
min-width:700px;
top:20px;
}
#wrapper {
float:left; width:100%
}
#content {
margin: 0 200px 0 200px
}
#content p {
line-height:1.4
}
#leftbar {
background:#b9caff; float:left; width:200px; margin-left:-100%
}
#rightbar {
position: absolute;
background:#ff8539;
right:0px;
width:200px;
}
#header {
position:absolute; top:0; width:100%; height:266px;
}
#header h1 {
line-height:80px; padding-left:10px; background:#eee; color:#79b30b
}
#contentbar {
position:absolute; top:80px; width:100%; z-index:1
}

#footer, #contentbar {
background:#333; color:#fff
}
#footer p, #contentbar p {
margin:0; padding:5px 10px; line-height:14px
}
#footer {
clear:left; width:100%
}

#topbar {
position:absolute; top:0px; width:100%; z-index:1;
height: 20px;
background-color:red;
}

</style>
</head>
<body>
<div id="container">
<div id="wrapper">
<div id="content">
<p><strong>1) Content here.</strong> column long long column very long fill fill fill long text text column text silly very make long very fill silly make make long make text fill very long text column silly silly very column long very column filler fill long make filler long silly very long silly silly silly long filler make column filler make silly long long fill very.</p>
</div>
</div>
<div id="leftbar">
<p><strong>2) leftbar here.</strong> long long fill filler very fill column column silly filler very filler fill fill filler text fill very silly fill text filler silly silly filler fill very make fill column text column very very column fill fill very silly column silly silly fill fill long filler</p>
</div>
<div id="rightbar">
<p><strong>3) More stuff here.</strong> very text make long column make filler fill make column column silly filler text silly column fill silly fill column text filler make text silly filler make filler very silly make text very very text make long filler very make column make silly column fill silly column long make silly filler column filler silly long long column fill silly column very</p>
<p>very make make fill silly long long filler column long make silly silly column filler fill fill very filler text fill filler column make fill make text very make make very fill fill long make very filler column very long very filler silly very make filler silly make make column column</p>
<p>fill long make long text very make long fill column make text very silly column filler silly text fill text filler filler filler make make make make text filler fill column filler make silly make text text fill make very filler column very</p>
<p>column text long column make silly long text filler silly very very very long filler fill very fill silly very make make filler text filler text make silly text text long fill fill make text fill long text very silly long long filler filler fill silly long make column make silly long column long make very</p>
</div>
</div>
<div id="contentbar"><p>4) Content bar here.</p></div>
<div id="header"><h1>5) Header</h1></div>
<div id="footer"><p>6) Here it goes the footer</p></div>
<div id="topbar"><p>7) Top Bar </p></div>
</body>
</html>

最佳答案

因为这不是付费代码网站,所以我不会为您编写所有代码。

这可能是个愚蠢的问题,但这不适合你吗?

body {
min-width: 600px;
}

关于css - 需要 3 列 CSS 布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6257424/

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