div和CSS一个简单的布局问题

<bodystyle="text-align:center;"><divid="header"style="width:950px;height:150px;margin... <body style="text-align:center;">

<div id="header" style="width:950px;height:150px;margin-left:auto;margin-right:auto;background-
color:green">头</div>

<div id="contain" style="display:block;margin:10 auto 10 auto;width:950px;height:auto;" >
<div id="left_part" style="display:inline- block;float:left;width:200px;height:1600px;background-
color:blue"><b>左侧</b></div>
<div id="right_part" style="display:inline-block;float:right;width:750px;height:1600px;background-
color:red"><b>右侧</b></div>
</div>

<div id="fd_part" style="width:950px;height:150px;background-color:yellow">底部</div>
</body>

是一个【头】、一个【中间】分左、右;然后一个【底】的布局;不知道哪里错了;老是重叠;高手也可以自己写一下这个布局,我看看,现在我比较乱
展开
 我来答
diaosu
2012-10-01 · 纸上得来终觉浅,绝知此事要躬行
diaosu
采纳数:2853 获赞数:6169

向TA提问 私信TA
展开全部
<body style="text-align:center;">

<div id="header" style="width:950px;height:150px;margin-left:auto;margin-right:auto;background-color:green">头</div>

<div id="contain" style="display:block;margin-left:auto;margin-right:auto;width:950px;height:auto;" >
<div id="left_part" style="display:inline-block;float:left;width:200px;height:1600px;background-color:blue"><b>左侧</b></div>
<div id="right_part" style="display:inline-block;float:left;width:750px;height:1600px;background-color:red"><b>右侧</b></div>
</div>
<div id="fd_part" style="width:950px;height:150px;background-color:yellow;margin-left:auto;margin-right:auto;clear:both; border:0px; padding:0px; ">底部</div>
</body>
追问
嗯,原来是fd_part加上一个clear 不允许两边div,按顺序不是应该罗列到最后,为什么不加就会叠加呢?如果一个div相对上一个div的距离可以直接写麽?
大莆田手机网
2012-10-02 · TA获得超过1179个赞
知道小有建树答主
回答量:1747
采纳率:85%
帮助的人:750万
展开全部
<div class="top" style="border:5px solid #000; width:950px; margin:0 auto;">上面</div>
<div style="margin:0 auto; width:960px;">
<div style="border:5px solid #F00; width:250px; float:left; overflow:hidden;">中左</div>
<div style="border:5px solid #00F; width:690px; float:right; overflow:hidden;">中左</div>
</div>
<div class="top" style="border:5px solid #0FF; clear:both; width:950px; margin:0 auto">下面</div>
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
deer607
2012-10-01
知道答主
回答量:20
采纳率:0%
帮助的人:7.2万
展开全部
<head>
<style>
div{ border:1px solid #000000; margin-bottom:10px;}
</style>
</head>

<body>
<div style="width:950px; margin:0 auto; border:none;">
<div style="height:150px;">头</div>

<div style="border:none">
<div style="float:left;width:200px;height:400px;"><b>左侧</b></div>
<div style="float:right;width:740px;height:400px;"><b>右侧</b></div>
</div>

<div style="width:950px;height:150px; clear:both;">底部</div>
</div>
</body>
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
紫婷66风
2012-10-07
知道答主
回答量:11
采纳率:0%
帮助的人:1.1万
展开全部
底的样式里面加个浮动样式 float:left; 这样这个层就会出现了
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
guweiqpzm
2012-10-01
知道答主
回答量:14
采纳率:0%
帮助的人:2.2万
展开全部
不知道呀
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
幸福白溪
2012-10-01 · 超过21用户采纳过TA的回答
知道答主
回答量:60
采纳率:0%
帮助的人:46.7万
展开全部
没看懂你是什么意思,
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(4)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式