469,963 Members | 1,924 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,963 developers. It's quick & easy.

Form element in DIV - 1px indent top and bottom in IE

12
hi all,

take a look to the file.



this is form in table, located in DIV layer.

on the left is FF and on the right is IE.
as You see, FF displays it correctly and IE has 1px on the top and bottom.

here is my code:

Expand|Select|Wrap|Line Numbers
  1. <div align="center">
  2. <div style="width:600px; margin:0px; padding:0px">
  3.  
  4. <table cellpadding="0" cellspacing="0" style="width:560px; border: 1px solid black; border-collapse:collapse">
  5.  
  6. <tr style="height:15px; border: 1px solid black">
  7. <td style="height:15px; width:15px; border: 1px solid black"></td>
  8. <td style="height:15px; border: 1px solid black; vertical-align:middle">
  9.  
  10. <form action="" style="padding:0px; margin:0px; display:block"><input type="text" maxlength="40" style="width:100px; height:15px; border: 1px solid black; padding:0px; margin:0px; display:block" />
  11. </form>
  12.  
  13. </td>
  14. <td style="height:15px; border: 1px solid black"></td>
  15. </tr>
  16. </table>
  17. </div>
  18. </div>
  19.  
what can You suggest, please?
May 8 '07 #1
2 2305
hi all,

take a look to the file.



this is form in table, located in DIV layer.

on the left is FF and on the right is IE.
as You see, FF displays it correctly and IE has 1px on the top and bottom.

here is my code:

Expand|Select|Wrap|Line Numbers
  1. <div align="center">
  2. <div style="width:600px; margin:0px; padding:0px">
  3.  
  4. <table cellpadding="0" cellspacing="0" style="width:560px; border: 1px solid black; border-collapse:collapse">
  5.  
  6. <tr style="height:15px; border: 1px solid black">
  7. <td style="height:15px; width:15px; border: 1px solid black"></td>
  8. <td style="height:15px; border: 1px solid black; vertical-align:middle">
  9.  
  10. <form action="" style="padding:0px; margin:0px; display:block"><input type="text" maxlength="40" style="width:100px; height:15px; border: 1px solid black; padding:0px; margin:0px; display:block" />
  11. </form>
  12.  
  13. </td>
  14. <td style="height:15px; border: 1px solid black"></td>
  15. </tr>
  16. </table>
  17. </div>
  18. </div>
  19.  
what can You suggest, please?
is this all your code? are you using a style sheet at all? i would put all your styling in a style sheet and attach it to the page. include the following code at the top of your css and it will help alot.

Expand|Select|Wrap|Line Numbers
  1. *{
  2. margin:0;
  3. padding:0;
  4. border:0;
  5. }
if that doesnt work then post both your css and html up here.

cheer
philleep
May 8 '07 #2
jhardman
3,406 Expert 2GB
A form inside a table inside a div? why bother? remove the table and the div and do all the positioning with css. It's cleaner, loads faster, and more likely to be interpreted the same in all browsers.

Jared
May 9 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by NWhite | last post: by
2 posts views Thread by Xah Lee | last post: by
1 post views Thread by Christopher P. Winter | last post: by
5 posts views Thread by MLibby | last post: by
9 posts views Thread by whisher | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.