tags:

views:

70

answers:

1

I am trying to have the button to display to the right of the textbox but it's displaying to the bottom in IE7.

<div style="margin-top: 12px; border: 1px red solid" >
          <asp:TextBox ID="txtSearh" name="txtSearch" runat="server" ></asp:TextBox>&nbsp;
          <button id="Search" accesskey="s" type="submit" runat="server" onserverclick="Search_Click" style="display: inline;float: left">
            <span><u>S</u>earch</span></button>
        </div>
+2  A: 

Remove this style attribute from your <button>:

style="display: inline;float: left"

A <button> is an inline element by default so you don't need display:inline and the float:left is what is making the button wrap to the next line.

Andrew Hare
And if it still wraps it means there isn't enough container width available to display the button next to the textbox. Make it wider or make the textbox and/or button smaller.
BC
I added the float in the last minute and because I didn't see a change, I left it. The culprit was a css file that changed the behavior of the button element plus a missing css file to fix IE. The html was working fine in FF. I thought it was an IE problem .problem.
Tony_Henrich