Thread: Drop down menu

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    1
    Rep Power
    0

    Drop down menu


    Hi,

    I am trying to make a drop down menu using only CSS. I want to be able to set the width of the menu and don't want the width to be dependant of size of the menu option.

    This is the XHTML code (I am using 1.0 strict):

    <div class="option">
    <form name="navigation">
    <select name="selectname" SIZE="1">
    <option class="">not wide enough</option>
    <option class=""></option>
    <option class=""></option>
    <option class=""></option>
    </select>
    </form>
    </div>


    And the CSS part:


    div.option
    {
    position: absolute;
    top: 10px;
    left: 0px;
    width: 520px;
    height: 50px;
    z-index: 3;
    font-family: verdana, arial, helvetica, sans-serif;
    font-size: 10px;
    }


    What I would really like is to set the menu width to preffered (in pixels) and not as wide as the phrase "not wide enough" makes it.

    Is this possible with CSS. I am rying to avoid Javascript and tables (btw I'm using only divs as much as possible. Can someone point me where to look for this kind of thing.

    Thanks.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2004
    Posts
    183
    Rep Power
    16
    Don't you just set the width of the select element to whatever?

    select {width:100px}

    btw are you sure SIZE="1" validates? I thought capitals were a no-no.

IMN logo majestic logo threadwatch logo seochat tools logo