bud58 beat me to the punch.
I thought I'd confirm his solution. Using
margin:-1px 0; works for input
type="text" but not for
p. In IE for
p it is necessary to use
margin:0 0 -1px 0; but this causes a 1px off set of
p with respect to
input in Google Chrome.
I think the safest solution would be to use IE conditional comments as in the following:
Code:
<html>
<head>
<style type="text/css">
#fixed-max input {width:100px;height:20px;border:0;margin:0;padding:0;background:yellow;}
#fixed-min input {width:100px;height:20px;border:0;margin:0;background:yellow;}
#fixed-max p {width:100px;height:20px;border:0;margin:0;padding:0;background:lime;}
#fixed-min p {width:100px;height:20px;margin:0;background:lime;}
</style>
<!--[if IE]>
<style type="text/css">
#fixed-max input {margin:-1px 0;}
#fixed-min input {margin:-1px 0;}
#fixed-max p {margin:0 0 -1px 0;}
#fixed-min p {margin:0 0 -1px 0;}
</style>
<![endif]-->
</head>
<body>
<table border="0" width="100" height="20" cellspacing="0" cellpadding="0">
<tr height="20"><td width="100" height="20" bgcolor="red"><input type=text
style="width:100px;height:20px;border:0;margin:-1px 0;padding:0;background:yellow;"></td>
<td bgcolor="blue"><p
style="width:100px;height:20px;border:0;margin:0 0 -1px 0;padding:0;background:lime;"> </p>
</td></tr>
</table>
<br>
<table border="0" cellspacing="0" cellpadding="0">
<tr><td bgcolor="red">
<input type=text style="width:100px;height:20px;border:0;margin:-1px 0;background:yellow;">
</td>
<td bgcolor="blue">
<p style="width:100px;height:20px;margin:0 0 -1px 0;background:lime;"> </p>
</td></tr>
</table>
<br>
<div id="fixed-max">
<table border="0" width="100" height="20" cellspacing="0" cellpadding="0">
<tr height="20"><td width="100" height="20" bgcolor="red"><input type=text></td>
<td bgcolor="blue"><p> </p></td></tr>
</table>
<br>
</div>
<div id="fixed-min">
<table border="0" cellspacing="0" cellpadding="0">
<tr><td bgcolor="red"><input type=text></td>
<td bgcolor="blue"><p> </p></td></tr>
</table>
</div>
</body>
</html>
__________________
- Michael Baker -
HTML Tags Guide - Reference and Tutorials
- Like voting, validate early, validate often -
W3C HTML Validator -
W3C CSS Validator
- Wot? me cynical? no, its just if you vote, er, validate early, you have more chance of validating often.