SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    yeeeeeep
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dropdown options larger than select?

    Hi guys, I've googled and even searched the forums for it, but I can't find anything on it.

    Is it possible to have a 100px wide dropdown box and once you clicked on it, it displays a 200px wide list of options?


    Edit...

    Using CSS to set select's width does the trick!

    Thanks!

  2. #2
    SitePoint Addict
    Join Date
    Aug 2006
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As far as I understant, you want this:
    Code:
      
    <style type="text/css">
    
    .select { background-color:blue; color: white; width:100pX;}
    .select2 { background-color:yellow; color: green; width:200pX;}
    </style>
    
    <select class="select" onchange="this.className='select2' ">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    </select>


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
  •