我有个层排版问题,上下层之间总是有缝隙,请大家帮我看看问题出在哪里!不胜感激!!!!

up2ulin 2007-12-10 01:32:39

<div style="padding-left:10px; width:751px;">
<div id="banner" style="width:751px; height:152px;"> <img src="img/main_banner.jpg" /> </div>
<div id="box_1" style="width:751px; margin-top:0px;">
<div id="title_1" style="width:300px; height:30px; background-image:url(img/title_1_bg.gif); background-position:top left; background-repeat:no-repeat; float:left;">
<h5 style="padding-left:100px; padding-top:6px; font-family:MSSong; color:#c164a4;">123123123</h5>
</div>
<div id="link_1" style="width:400px; height:30px; float:right;">aaa </div>
<div id="centent_bg" style="width:751px; height:402px; background-color:#CCCCCC; margin-top:0px; float:left;">
<div id="centent_1" style="width:747px; height:400px; background-color:#FFFFFF; margin:0px 2px 2px 2px;"> </div>
</div>
</div>
</div>
...全文
131 点赞 收藏 5
写回复
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
yixianggao 2007-12-10
咋了?还不行?

刚才你发滴消息俺不小心给关了,再发一下,哈!
回复
yixianggao 2007-12-10
把 img 与 div 间空格删除就好了!
L@_@K
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="Gao YiXiang" />
<meta name="email" content="yixianggao@126.com" />
<meta name="keywords" content="javascript dhtml dom" />
<meta name="description" content="I love web development." />
</head>
<body>
<div style="padding-left:10px; width:751px;">
<div id="banner" style="width:751px; height:152px;background-color: red;"><img src="img/main_banner.jpg" /></div>
<div id="box_1" style="width:751px; margin-top:0px;background-color: blue;">
<div id="title_1" style="width:300px; height:30px; background-image:url(img/title_1_bg.gif); background-position:top left; background-repeat:no-repeat; float:left;">
<h5 style="padding-left:100px; padding-top:6px; font-family:MSSong; color:#c164a4;">123123123</h5>
</div>
<div id="link_1" style="width:400px; height:30px; float:right;">aaa </div>
<div id="centent_bg" style="width:751px; height:402px; background-color:#CCCCCC; margin-top:0px; float:left;">
<div id="centent_1" style="width:747px; height:400px; background-color:#FFFFFF; margin:0px 2px 2px 2px;"></div>
</div>
</div>
</div>

</body>
</html>
回复
up2ulin 2007-12-10
banner 和 box_1 之间有空隙, box_1和其内部的title_1之间也有空隙~我市初学xhtml,是不是我少设置了哪个属性阿~
弄得我头疼了!55555555
回复
yixianggao 2007-12-10
你指哪两个层间?
banner 与 box_1 之间没有空隙!
L@_@K

<div style="padding-left:10px; width:751px;">
<div id="banner" style="width:751px; height:152px;background-color: red;"> <img src="img/main_banner.jpg" /> </div>
<div id="box_1" style="width:751px; margin-top:0px;background-color: blue;">
<div id="title_1" style="width:300px; height:30px; background-image:url(img/title_1_bg.gif); background-position:top left; background-repeat:no-repeat; float:left;">
<h5 style="padding-left:100px; padding-top:6px; font-family:MSSong; color:#c164a4;">123123123</h5>
</div>
<div id="link_1" style="width:400px; height:30px; float:right;">aaa </div>
<div id="centent_bg" style="width:751px; height:402px; background-color:#CCCCCC; margin-top:0px; float:left;">
<div id="centent_1" style="width:747px; height:400px; background-color:#FFFFFF; margin:0px 2px 2px 2px;"> </div>
</div>
</div>
</div>
回复
up2ulin 2007-12-10
我的上下层之间总是有缝隙,而且最外的div总是有溢出,可是我已经给每个层规定宽度了阿,为什么还有溢出,困惑,大家来帮我看看阿~!!555555
回复
发动态
发帖子
CSS
创建于2007-09-28

5.9w+

社区成员

层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
申请成为版主
社区公告
暂无公告