SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict Philip Toews's Avatar
    Join Date
    Dec 2001
    Location
    Kuala Belait, Brunei
    Posts
    367
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    select menu width with CSS control?

    What's the best way to control the width of a SELECT menu? I've got a SELECT menu that is populated by a PHP call to a MySQL database. The problem is that the select options are too wide and mess up my page layout.

    Is it possible to control the width with CSS, or should I truncate the select options with PHP before I put them into the select menu?

    You can see an example here

    just look at the
    By grammar concept or language function:
    menu....see how it overlaps the tower ad on the right hand side of the layout?

    Any ideas here?

    p
    Philip Toews Professional esl Educator and ASP.NET wannabe

    http://www.philiptoews.com
    philip@philiptoews.com

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2002
    Location
    Bristol, UK
    Posts
    2,240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try adding:

    style="width: 100px;" into the SELECT tag, replacing 100 with the width you need.

    Hope this helps.

    -Sam


Bookmarks

Posting Permissions

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