...

View Full Version : Make drop-downs in form the same width



jake66
08-02-2011, 12:01 PM
Hi,

There is probably a really simple answer to this, but...I don't know it!

I have a form with one text input box and three drop-downs:

http://i53.tinypic.com/15fspjc.png

How can I make them all the same width so it looks neat?

Thanks, jake66

Rowsdower!
08-02-2011, 01:01 PM
Just use some CSS width styling, something like this:

select {width:250px;}

If you want the input element to be the same width as the select elements then you can just add the input to the style also, like this:

select,input {width:250px;}

Just adjust the 250px figure there to whatever width looks good to you.

Note that this will make the submit button also that same width, so you will need to give the submit button an ID or a class and then adjust the width for that specific class separately. That could look something like this:

HTML:
<input type="submit" class="submit_button" value="Submit" />

CSS:
input.submit_button {width:auto;}

jake66
08-03-2011, 01:13 PM
Just use some CSS width styling, something like this:

select {width:250px;}

If you want the input element to be the same width as the select elements then you can just add the input to the style also, like this:

select,input {width:250px;}

Just adjust the 250px figure there to whatever width looks good to you.

Note that this will make the submit button also that same width, so you will need to give the submit button an ID or a class and then adjust the width for that specific class separately. That could look something like this:

HTML:
<input type="submit" class="submit_button" value="Submit" />

CSS:
input.submit_button {width:auto;}

Thanks!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum