CSS表单问题

来源:百度知道 编辑:UC知道 时间:2024/07/06 10:20:11
谁能告诉我 为什么 显示结果在IE和火狐中会不一样,特别是高度部分,如何才能一样- -!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
#formwrapper{
width:812px;
line-height:19px;
background:#3ea8d2;
}

.input{
border:1px solid #666699;
height:17px;
}
</style>
</head>
<body>
<div id="formwrapper">
<form id="form1" name="login" method="post" action="">
<label> 用户名:</label>
<input class="input" name="username

那是因为你没有给你那个蓝色的层添加高度在<style type="text/css">
#formwrapper{
width:812px;
height:25px;
line-height:19px;
background:#3ea8d2;
}

.input{
border:1px solid #666699;
height:17px;
}
</style>
添加上height:25px;就行了