I have a simple page with two elements:
<html>
<body>
<input type="text" style="height: 18px; width: 120px" /><br/>
<select style="height: 18px; width: 120px">
<option>test</option>
</select>
</body>
</html>
In an attempt to make it w3c compliant and to display consistently across browsers, I've added a DOCTYPE element and an XML namespace:
<!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">
<body>
<input type="text" style="height: 18px; width: 120px" /><br/>
<select style="height: 18px; width: 120px">
<option>test</option>
</select>
</body>
</html>
The CSS is just an attempt to make the widths and heights of both the textbox and select box the same.
However, for some reason, the 2nd page no longer respects the height and width CSS attributes I've set on the input tag. The textbox is about 4 pixels taller in each browser (IE, Firefox, Chrome) and 4-6 pixels wider in each browser.
I've used various developer tools to try to find out what additional markup is being applied, but I can't find any.
If possible, could someone explain this behavior to me?
Any help would be much appreciated.
Thanks,
B.J.