主站
经典论坛
作品集
Think.Pages
博客
维基
桌面
聚合
注册
登录
专长会员
帮助
客服QQ:6650171
经典论坛
«
WEB标准化专栏
« FIREFOX下DIV不能自适应宽度
‹‹ 上一主题
|
下一主题 ››
发新话题
发布投票
发布商品
发布悬赏
发布活动
发布辩论
发布视频
打印
[求助]
FIREFOX下DIV不能自适应宽度
pdsxb
[楼主]
初级会员
帖子
45
体力
119
威望
0
当前
北京 东城区
离线
2 天
发短消息
1
#
大
中
小
发表于 2008-5-9 17:19
<!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> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <style type="text/css"> <!-- * { margin: 0px; padding: 0px; } .contentbk { width: 900px; margin-right: auto; margin-left: auto; } body { font-size: 12px; } .navbk { border-top: 1px none #a4cde3; border-right: 1px solid #a4cde3; border-bottom: 1px solid #a4cde3; border-left: 1px solid #a4cde3; overflow: hidden; float: left; width: 218px; } .nrbk { width: 300px; margin-right: auto; margin-left: auto; } .navnr ul { list-style-type: none; margin-bottom: 5px; } .navnr a { color: #333333; text-decoration: none; } .navnr li { float: left; text-align: center; line-height: 25px; margin-right: 5px; margin-left: 5px; font-size: 14px; } .navnr a:hover { color: #FF9900; text-decoration: underline; } #left { float: left; width: 300px; } #center { float: left; width: 380px; margin-left: 11px; } .normalblock1 { margin-top: 10px; border: 1px solid #A4CDE3; overflow: hidden; } .normalbt { background: url(normalbtbg.jpg) repeat-x left top; height: 25px; text-align: center; line-height: 25px; color: #048bd5; font-weight: bold; } .normalbt ul { list-style-type: none; } .normalbt li { float: left; width: 99px; cursor: pointer; list-style-type: none; height: 25px; display: block; } .noramlnrbk { padding-left: 10px; } #right { float: left; width: 198px; margin-left: 11px; } #center,#left,#right { margin-top:10px; } #hotbbslayout li { float: left; background: url(dot2.jpg) no-repeat left center; text-indent: 0px; margin-right: 20px; } #hotbbslayout a { font-size: 13px; color: #666666; text-decoration: none; padding-left: 10px; } #hotbbslayout a:hover { font-size: 13px; color: #666666; text-decoration: underline; padding-left: 10px; } .noramlnrbk ul { list-style-type: none; color: #666666; } .noramlnrbk a { color: #666666; text-decoration: none; } .noramlnrbk li { height: 25px; line-height: 25px; } .noramlnrbk a:hover { color: #333333; text-decoration: underline; } #tysp { float: left; width: 65px; margin-left: 20px; display: inline; } .normalpicbk { padding: 1px; float: left; height: 78px; width: 118px; border: 1px solid #CCCCCC; margin-top: 5px; margin-right: 8px; background-color: #006633; } .normaldl { margin-top: 8px; float: left; } *:lang(zh) .nrbk ul { float:left; } .normalbt .rb3 { background: url(none) no-repeat; } .normaldl p { font-size: 12px; line-height: 1.5em; color: #999999; text-indent: 4ex; } #spfunc { line-height: 20px; color: #666666; height: 20px; } .normaldl p.p1 { font-size: 12px; line-height: 1.5em; color: #149FE2; } .normaldl p a { color: #990000; text-decoration: underline; } .normaldl p a:hover { color: #333333; text-decoration: underline; } --> </style> </head> <body lang="zh"> <div class="nrbk"> <div class="normalpicbk"></div> <div class="normaldl"> <p class="p1">这个周末就是母亲节了,我们祝天下所有的妈妈母亲节快乐!我们应该怎我们...<a href="#">详细</a></p> <div id="spfunc">播放:231 评论:231</div> </div> <ul> <li>医保卡有望全国联全国联网实行社保“一卡</li> <li>中央财政:今年安排560亿全国联支持深化“</li> <li>《人鬼情未了》主角患全国联胰腺癌 命剩五</li> <li>中央财政:今年安排560亿全国联支持深化“</li> </ul> </div> </body> </html>
提示:您可以先修改部分代码再运行
以上代码在FF下浏览的时候 <div class="normaldl">这个层将自动移动到 <div class="normalpicbk"></div>
的下面显示,在IE下没有这个问题,如果给 <div class="normaldl">定义一个宽度就没问题,但是这个层是个通用层,会出现在需要的层里面,宽度自适应,所以不能定义宽度,有什么解决方法么?
积分
119
阅读权限
20
在线时间
53 小时
注册
2007-5-23
最后登录
2008-7-4
查看详细资料
TOP
alittleninja
初级会员
帖子
35
体力
86
威望
0
离线
2 天
发短消息
2
#
大
中
小
发表于 2008-5-9 18:38
把<div class="normaldl">的浮动去掉
积分
86
阅读权限
20
在线时间
121 小时
注册
2007-1-30
最后登录
2008-7-4
查看详细资料
TOP
pdsxb
[楼主]
初级会员
帖子
45
体力
119
威望
0
当前
北京 东城区
离线
2 天
发短消息
3
#
大
中
小
发表于 2008-5-12 08:53
<div class="normaldl">浮动取消后确实可以正常显示宽度,但是又有一个新问题,<div class="normalpicbk"></div>的上边距加大了,还有好的办法么?
积分
119
阅读权限
20
在线时间
53 小时
注册
2007-5-23
最后登录
2008-7-4
查看详细资料
TOP
ycsy520
初级会员
帖子
76
体力
152
威望
0
当前
广东 深圳
离线
38 天
发短消息
个人网站
4
#
大
中
小
发表于 2008-5-12 09:53
貌似你的css冗余代码很多...
然后是你的结构貌似不是很合理...
不写拉倒~
积分
152
阅读权限
20
性别
男
在线时间
28 小时
注册
2007-12-12
最后登录
2008-5-29
查看个人网站
查看详细资料
TOP
‹‹ 上一主题
|
下一主题 ››
版块跳转 ...
> 前台制作与脚本专栏
> 后台数据库编程
> WEB标准化专栏
> WAP 技术专栏
> 艺术与设计论坛
> Adobe Photoshop 专栏
> Fireworks 专栏
> 矢量图形专栏
> 插画手绘交流
> 用户体验综合版
> UI图形设计
> Flash 8 及之前版本
> Flash CS3 及 AS3
> Silverlight 专版
> Director 专栏
> 计算机技术
> 英语学习和技术翻译
> 摄影欣赏与技术交流
> 无线通讯与数码设备
> 企业招聘
> 体育运动、线下活动与游戏
> 创业版
做西部数码代理.Cn1元国际45元