div css 对齐问题(附源码)

来源:百度知道 编辑:UC知道 时间:2024/05/09 16:15:12
<!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="test/css">
html,body{ margin-left:0; margin-top:0; padding:0; border:none; font-size:12px; color:#000000; font-family:"宋体";}
body{ margin:0 auto}

#banner{}
#nav{}
#text{}
#footer{}

</style>

</head>

<body>

<div id="banner">test</div>
<div id="nav"&

<style type="test/css"> 改成“<style type="text/css"> ”

style之间加个body {margin: 0px;} 即可解决问题的。。

Test 》text,打错啦。

默认情况下,BODY本身是留了边距的。