为了账号安全,请及时绑定邮箱和手机立即绑定

设置的div块无法显示

设置的div块无法显示

落子鸢 2016-04-24 20:32:18
<!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=utf-8" /> <title>大庆师范学院</title> <style type="text/css"> body{margin:0; padding:0} #top{width:auto; height:110px;  background:#777777;} #main{ width:1010px; height:auto; margin:0 auto; background:#AAAAAA;} #left{width:750px; height:600px; float:left; background:#33FF99;} #sub_u{width:750;} #sub_d{} #right{ width:260px; height:600px; float:right; background:#00FF00;} #foot{  width:1010px;  height:70px;  background:#555;  margin:0 auto; } </style> </head> <body> <body> <div id="top" ></div> <div id="main">   <div id="left">    <div id="sub_u"></div>     <div id="sub_d"></div>   </div>   <div id="right"></div> </div>  <div id="foot"></div>  </body> </html> 上边为代码,设置的ID为“foot”的块状元素无法显示怎么改????
查看完整描述

3 回答

已采纳
?
侠客岛的含笑

TA贡献552条经验 获得超285个赞


你的这个问题是foot margin:0 auto;上下外边距为0,左右自动居中,所以他就剧终了,但是你的main 的也是居中,所以就被覆盖了,你把margin改一下,或者用刚才那个同学的建议

查看完整回答
1 反对 回复 2016-04-25
?
我很不愉快

TA贡献1条经验 获得超0个赞

#foot{

 clear:both;

 width:1010px;

 height:70px;

 background:#555;

 margin:0 auto;

}



查看完整回答
反对 回复 2016-04-26
  • 3 回答
  • 0 关注
  • 1899 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信