Results 1 to 8 of 8

Thread: html option tag styling?

  1. #1
    Join Date
    Jul 2009
    Location
    Binus University
    Posts
    472
    Thanks
    78
    Thanked 21 Times in 21 Posts

    Default html option tag styling?

    Hi, here's the problem how to make option tag style like this one?



    thank you very much
    _____________________

    David Demetrius // davejob
    _____________________

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    I'm not sure you can without using Flash. You can use a background image in the CSS to alter the look of the input field, but the drop-down arrow is generated by the browser. The arrow will look nicer in newer browsers and I imagine the nicest (probably very similar to your example pic) in Mac. [please feel free to correct me if I'm wrong though]

    Code:
    <select class="form-field" name="number" id="number">
    <option value="One">One</option>
    <option value="Two">Two</option>
    <option value="Three">Three</option>
    </select>
    Code:
    select.form-field {
    background:transparent url("images/form-field.jpg") 0 0 no-repeat;
    border:none; 
    color:#666; 
    padding:7px; 
    width:200px; 
    float:left; 
    }
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    Jul 2009
    Location
    Binus University
    Posts
    472
    Thanks
    78
    Thanked 21 Times in 21 Posts

    Default

    Hi Beverleyh, thx for your reply.

    I used the same method like you did, and that right the only problem is the arrow button. I think there's some kind of JS or Jquery to solve this.

    Hmm, i think i posted it in the wrong section.
    _____________________

    David Demetrius // davejob
    _____________________

  4. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    something like this might be what you're looking for

  5. #5
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    I'll make a note of that one too - thanks traq
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  6. #6
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    From a css-point-of-view, there's not much you can do in the case of (authentic!) select boxes, see this.
    ===
    Arie Molendijk

  7. #7
    Join Date
    Jul 2009
    Location
    Binus University
    Posts
    472
    Thanks
    78
    Thanked 21 Times in 21 Posts

    Default

    thx traq, Beverleyh's, molendijk
    _____________________

    David Demetrius // davejob
    _____________________

  8. #8
    Join Date
    Sep 2010
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default



    You can create a long div at the left with background and the text you want, then the div on the right would be the arrow.
    make sure that they float next to each other.

    Then add a javascript code that will toggle to show the 3rd div at the bottom.

    Inside the 3rd div follow http://web.enavu.com/demos/jquery_hover/ and add exact the same thing.
    remove ul border or the div border and change your hover color.

    i hope that helps.
    Last edited by Lozu; 12-05-2010 at 11:37 AM.

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
  •