First, explain how the form label (input, select) might behave differently in various browsers:
1. When input or select is mixed with other labels (for example, a, label), there may be a problem that is not centered.
2 .... When mixed, the outer label does not control the form label.
3.input inside the text line high There are differences, there are gaps and so on.
Parsing phenomena:
Input:text characteristics,
By default:
Height of 1.firefox height is 14px under 16px;ie;
2. Font size: 13.3333px;
3.input exists padding value: Firefox: padding:1px 0;ie: padding:1px 0 3px 0;
Solution Example: The following code:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title> Untitled Document </title>
<style type= "Text/css" >
Body {
font-family: "Song Body";
font-size:12px;
}
Table {
Border-collapse:collapse;
Border:solid Red 1px;
}
td,th {
Border:solid Red 1px;
height:40px;
}
Label {
Vertical-align:middle;
}
. inputtxt {
width:200px;
padding:0;
font-family: "Song Body";
font-size:12px;
height:15px;
line-height:15px;
Vertical-align:middle;
Border:solid #0000FF 1px;
}
</style>
<body>
<form action= "#" method= "POST" >
<table>
<tr>
<th width= ">firt</th>"
<TD ><input name= "AJ" type= "text" maxlength= "6" class= "Inputtxt"/>
<label> know </label>
<input type= "Text" maxlength= "6" class= "Inputtxt"/></td>
</tr>
<tr>
<th>second</th>
<td>
<input name= "BS" type= "text" maxlength= "6" class= "Inputtxt"/></td>
</tr>
</table>
</form>
</body>
In this case, IE and Firefox are the same as: