The css alignment order is a bit black art with CSS2, so let me tell you what happens:
1) reset.css, you probably DO NOT reset the padding of the input element, so you get this with a 1/2 pixel error
Try adding them to your style.
So, you need to remove this add-on from the input:
input { padding: 0 }
Now you will need to set the height of both the shortcuts and the input elements:
.fld { height: 16px; } .usr { height: 16px; }
Another thing is that you probably want to align the fields well one after another. One way to achieve this is to make the label a block with a floating point position:
.usr { display: block; float: left; }
and .fld block:
.fld { display: block }
you would like to add some other parameters to p
to make the rendering more aesthetically pleasing.
Here is what I did with your file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Southrock HTML template</title> <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" /> <link rel="stylesheet" type="text/css" href="reset.css" /> <style> body { font-family:Verdana,Arial,"Lucida Grande","Lucida Sans Unicode",sans-serif; font-size:13px; margin:20px; } input { border:solid 1px #666; width:150px; padding: 0; height: 16px; } .fld { } .usr { border:solid 1px red; height: 16px; display: block; float: left; margin-right: 5px; width: 7em; } p { clear: both; margin-bottom: 5px; } </style> </head> <body> <p> <label class="usr" for="email">Email*</label> <input class="fld required email" type="text" name="email" id="email" value="Capital Letter"> </p> <p> <label class="usr" for="email">First Name*</label> <input class="fld required email" type="text" name="fname" id="fname" value="Capital Letter"> </p> </body> </html>
It does the same in IE / Safari / FF / Opera
Ahmed masud
source share