Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Apr 2010
    Posts
    417
    Thanks
    4
    Thanked 1 Time in 1 Post

    limited the width of SELECT showing on page

    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?

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,919
    Thanks
    6
    Thanked 1,040 Times in 1,013 Posts
    Do it with CSS:
    Code:
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •