Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How to style form <select> tags completely?

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #25214
    Frodo64
    Member

    Anyone know any efficient way how to style from <select> tags? I mean completely: add background image and style <option> values? I’m looking for cross browser technique. Maybe anyone did it and can share the knowledge?

    #59381
    apostrophe
    Participant

    It can’t be done with css alone. Check out this jQuery plugin http://www.scottdarby.com/2009/05/jquery-plugin-stylish-select-unobstrusive-select-box-replacement/

    #59382
    Frodo64
    Member

    Thanks! I will try to use it right now :)

    #59399
    Frodo64
    Member
    "apostrophe" wrote:

    It is wokring fine on Firefox, but it’s buggy in IE6, IE7. Maybe I’m doing something wrong?

    [attachment=0]wrong.jpg[/attachment]

    The css of this select:

    Code:
    ul.newList {margin:0; padding:0; list-style:none; color:#666; width:160px; background:#feffff; position:absolute; display:none; border:1px solid #666; top:22px; left:0; overflow:auto; z-index:9999;}
    .newListSelected {width:150px; color:#666; height:18px; padding:4px 0 0 12px; float:left; background:url(images/search-select-bg.gif) no-repeat; outline:none;}
    .newListSelected span {width:162px; display:block;}
    ul.newList li {padding:3px 12px;}
    .selectedTxt {width:127px; overflow:hidden; height:16px; padding:0 23px 0 0;}
    .hiLite {background:#23788B!important; color:#feffff!important;}
    .newListHover {background:#ccc!important; color:#000!important; cursor:default;}
    .newListSelHover {cursor:default;}
    .newListOptionTitle {font-weight:bold;}
    .newListOptionTitle ul {margin:3px 0 0;}
    .newListOptionTitle li {font-weight:normal; border-left:1px solid #666;}

    The link: LINK DELETED

    #59402
    Frodo64
    Member

    After testing like 6 other jquery plugins I came back to this one. The whole thing about ie’s was the z-index property..

    #59400
    apostrophe
    Participant

    So it’s working now? I confess I’ve never used the plugin. When it comes to forms, if it can’t be done with css alone then I don’t bother. I’d rather lose a little style and keep the functionality and accessibility.
    If you can’t solve the z-index issue I would suggest contacting the plugin author who claims that it works in all browsers from ie6 up.

    #59427
    Frodo64
    Member

    Yes it is working right now. Thanks for nice plugin link :)

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.