align textbox in div

hi there; i have a simpe <div> 25px high and 600px wide.

i want to put a textbox in there that is the exact height (25px) and 200px wide.

<div style="width:600px; height:25px; background-color:Blue;">
    <asp:TextBox ID="txtText" runat="server" style="height:25px; width:200px; font-size:100%; padding:0px; margin:0px; border:0px;" />
    </div>

in firefox, this works perfectly.  in ie it leaves a 1 px space above it (see image).

suggestions?

thanks all.
textbox.jpg
LVL 1
vbnewbie01Asked:
Who is Participating?
 
aibusinesssolutionsCommented:
Or just use position:absolute; in your textbox, works in both IE and Firefox.

style="height:25px; width:200px; font-size:100%; padding:0px; margin:0px; border:0px; position:absolute;"
0
 
CB_ThirumalaiCommented:
Can you try this? Works both in IE and Firefox
<div style="width:600px; height:25px; background-color:Blue;">
    <asp:TextBox ID="txtText" runat="server" style="height:25px; width:200px; font-size:100%; position:relative;top:-2px; margin:0px; border:0px;" />
</div>

Open in new window

0
 
vbnewbie01Author Commented:
leaning toward aibusinesssolutions and thanks to you both but can either of you explain why the space was there in the first place?
0
 
aibusinesssolutionsCommented:
One of the biggest quirks between IE and Firefox is how they display their textboxes. Unfortunately, there is not much you can do other than customizing the styles to get them close.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.