一个小测试在IE6,7里正常显示到FF里乱七八糟,高手帮改下

xuexijava 2009-12-30 05:07:45
如题。。。
代码如下:

<!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">
*{
margin:0px;
padding:0px;
border:0px;
font-size:12px;
font-family:"新宋体", "宋体", "黑体";
}
body{
background:#ACA564;
text-align:center;
}
#aa{
width:300px;
height:150px;
background:#EBECE6;
margin-top:200px;
text-align:left;
}
form{
padding:10px 15px 10px 15px;
}
label{
float:left;
width:80px;
text-align:right;
margin:8px auto 8px auto;
}
input{
border:1px solid #CC9966;
margin:3px auto 3px auto;
background:#E1EBB1;
height:20px;
}
#bb{
}
#bt{
text-align:center;
margin-top:5px;
}
#cc{
text-align:center;
padding-top:5px;
padding-bottom:5px;
background:#CC9933;
}
#cc span{
font-size:14px;
font-weight:bold;}
</style>
</head>

<body>
<div id="aa">
<div id="cc"><span>管理员登陆</span></div>
<form>
<div id="bb">
<label>用户名:</label>
<input type="text" />
</div>
<div id="bb">
<label>密码:</label>
<input type="password" />
</div>
<div id="bt">
<input type="submit" value="登陆"/>
<input type="reset" value="重置"/>
</div>
</form>
</div>
</body>
</html>
...全文
57 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
snowtscx 2009-12-30
  • 打赏
  • 举报
回复
#aa{
margin:200px auto 0 auto; //置中
}

label{
margin:7px auto 7px auto; //高度问题
}

xuexijava 2009-12-30
  • 打赏
  • 举报
回复
能说下为什么吗。。。。。。?
snowtscx 2009-12-30
  • 打赏
  • 举报
回复

<!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">
*{
margin:0px;
padding:0px;
border:0px;
font-size:12px;
font-family:"新宋体", "宋体", "黑体";
}
body{
background:#ACA564;
text-align:center;
}
#aa{
width:300px;
height:150px;
background:#EBECE6;
margin:200px auto 0 auto;
text-align:left;
}
form{
padding:10px 15px 10px 15px;
}
label{
float:left;
width:80px;
text-align:right;
margin:7px auto 7px auto;
}
input{
border:1px solid #CC9966;
margin:3px auto 3px auto;
background:#E1EBB1;
height:20px;
}
#bb{
}
#bt{
text-align:center;
margin-top:5px;
}
#cc{
text-align:center;
padding-top:5px;
padding-bottom:5px;
background:#CC9933;
}
#cc span{
font-size:14px;
font-weight:bold;}
</style>
</head>

<body>
<div id="aa">
<div id="cc"> <span>管理员登陆 </span> </div>
<form>
<div id="bb">
<label>用户名: </label>
<input type="text" />
</div>
<div id="bb">
<label>密码: </label>
<input type="password" />
</div>
<div id="bt">
<input type="submit" value="登陆"/>
<input type="reset" value="重置"/>
</div>
</form>
</div>
</body>
</html>

61,111

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧