Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2006
    Location
    Sweden
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    style the box containing the options in a selectbox?

    Is it possible? (What I want to do is to remove the border and the background color from the box containing the options in the picture)


  • #2
    Senior Coder ahallicks's Avatar
    Join Date
    May 2006
    Location
    Lancaster, UK
    Posts
    1,134
    Thanks
    1
    Thanked 57 Times in 55 Posts
    Try putting:

    select {
    background: none;
    border: none;
    }

    or

    option {
    background: none;
    border: none;
    }

    ???

  • #3
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,387
    Thanks
    32
    Thanked 288 Times in 282 Posts
    Quote Originally Posted by ahallicks View Post
    background: none;
    Wrong keyword there. You don’t want background-image: none; you want background-color: transparent. I suppose you could do both to account for more possibilities though: background: transparent none.

    Based upon a test with Firefox 2, select { border-width: 0; background-color: transparent; } seems to work okay. However, while the background color and the outer border is removed, a one pixel‐wide white border remains. Internet Explorer 7 ignores attempts to style the select and option elements. Opera 9 allows removal of the border, but ignores the background-color declaration.

    I use a custom theme for Windows XP, so that may have affected the results. In any case, you’re going to have limited control over how you can style form elements since they’re replaced elements.
    For every complex problem, there is an answer that is clear, simple, and wrong.


  •  

    Posting Permissions

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