View Full Version : limited the width of SELECT showing on page

Aug 4th, 2010, 12:57 PM
I have a selection box and sometimes the data is long and the selection box goes off the screen, i.e. if i have 20 characters it is ok, but if lets say one of the entries is 60 characters then it shoots off the page and messes up the rest of the page.

how do i limit the width of the selection field to say 30 characters wide?

Aug 4th, 2010, 01:04 PM
Do it with CSS:

select {width: ??px;}

However, we don’t set it by characters but by pixels, centimeters, inch, or em. You can, however, look how wide 60 characters would be and then set the width accordingly in above mentioned units.