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 4 of 4
  1. #1
    New Coder
    Join Date
    Jul 2005
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Example of changing <select> border color in css

    Ok... So I am trying to change the border color of a select field and everyone says it can't be done, but it can. See http://www.nic.fi/~tapio1/Teaching/Models/Model23b.html when you put your mouse over top of the select box, it outlines in red. I put the css from this page into my contact form http://www.rollersports.ca/contacts.htm , and it doesn't work... Can anyone tell me why?

  • #2
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,708
    Thanks
    0
    Thanked 237 Times in 232 Posts
    Hi there titanic_fanatic,

    as i pointed out in your other thread, only Opera appears to give select border styling full support.

    To get a slight border in Firefox or your favourite - Netscape 8 - change this line in your stylesheet....
    Code:
    select {
         width: 125px; 
         border-right: red 2px solid;
         border-top: red 2px solid; 
         border-left: red 2px solid; 
         border-bottom: red 2px solid; 
         background-color: #ffffff;
    }
    ...to this...
    Code:
    select {
         width: 125px; 
         border-right: red 2px solid;
         border-top: red 2px solid; 
         border-left: red 2px solid; 
         border-bottom: red 2px solid; 
         background-color: #fffffe;
    }
    ...and you will perceive a thin red line on the top and sides, but you will not be able to give this
    'pseudo border' any width whatsoever.
    As for IE there is only the default border.

    coothead

  • #3
    New Coder
    Join Date
    Jul 2005
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Eureka

    Thank you so much... That fixed everything. It's exactly what I wanted.

    If you don't mind me asking, why is it that I needed to change the background color to #fffffe instead of #ffffff?

  • #4
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,708
    Thanks
    0
    Thanked 237 Times in 232 Posts
    Hi there titanic_fanatic,
    If you don't mind me asking, why is it that I needed to change the background color to #fffffe instead of #ffffff?
    Well, your guess is as good as mine.
    The border will only make an appearance if the background-color is not set to #ffffff.

    coothead


  •  

    Posting Permissions

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