What's the usual way to setup input textbox width (and be cross-browser) ?

C

craigkenisston

I'm creating a form with asp.net.
I have my inputs like this :

<label for="USER_COMPANY">Company Name:</label>
<asp:textbox id="USER_COMPANY" runat="server" cssclass="inputBox"
style="width:250px"></asp:textbox><br >

This worked great until I used the designer and it took ride of the
"style=width:250px" and changed them without my approval for
"width:250px".

The worst thing. The "width:250px" is correctly rendered to IE as
"style=width:250px", very expectable and nice. But for Firefox and
Opera it does not !. Actually, it does not return nothing about the
input textbox width to those browsers.

What's the solution for this ? Every time I touch the designer, it
drops my "correct" markup.
 
B

Ben Amada

<label for="USER_COMPANY">Company Name:</label>
<asp:textbox id="USER_COMPANY" runat="server" cssclass="inputBox"
style="width:250px"></asp:textbox><br >

It should work if you define the width in your CSS file under "inputBox".
You can then drop the style="width:250px" out of your aspx file.

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top