div css对齐问题

来源:百度知道 编辑:UC知道 时间:2024/05/16 15:02:41
以下代码哪里有问题,头都大了,为什么不能左对齐和上对齐啊,定义了margin为0了啊,而且是按教程做的。
<!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&

<style type="test/css">
改成,
<style type="text/css">
马虎了吧。

那上面是定义身体的,banner 这里你都没定义但然不行了。只是定义了名称有与没有是一样的。