Current location: Hot Scripts Forums » General Web Coding » CSS » Changing look of dropdown boxes using CSS


Changing look of dropdown boxes using CSS

Reply
  #1 (permalink)  
Old 07-12-06, 06:36 PM
Frogger Frogger is offline
Wannabe Coder
 
Join Date: Jul 2006
Posts: 149
Thanks: 5
Thanked 0 Times in 0 Posts
Changing look of dropdown boxes using CSS

Hi All,

I know you can change the look on input boxes using CSS. ie changing border size, colour and text area but for some reason I can't do the same using the select function (ie dropdowns). Is there a way of doing this using CSS or is this function restricted on dropdowns.

Thanks for your help.

Regards
Frogger
Reply With Quote
  #2 (permalink)  
Old 07-14-06, 02:46 PM
landing's Avatar
landing landing is offline
Coding Addict
 
Join Date: Jul 2006
Location: Scotland
Posts: 302
Thanks: 0
Thanked 0 Times in 0 Posts
You can indeedy. It's just CSS again

Code:
select {
    border-style:solid;
    border-color:#000000;
    border-width:1px 1px 1px 1px;
    background-color:#666666;
    color:#FF0000;
}
Hope that helps.

Cheers
Reply With Quote
  #3 (permalink)  
Old 07-16-06, 02:54 PM
Frogger Frogger is offline
Wannabe Coder
 
Join Date: Jul 2006
Posts: 149
Thanks: 5
Thanked 0 Times in 0 Posts
Thanks for getting back to me. It seems like only a few of the options work within which are:

font-size: 14pt;
background-color:#666666;
color:#FF0000;
font-family: verdana;

The ones that dont work it seems with dropdowns are:

border-style:solid; (tried none - didnt work)
border-color:#000000; (tried other colours - didnt work)
border-width:1px 1px 1px 1px; (tried other numbers - didnt work)

Has anyone experienced the same problems.

Regards
Frogger
Reply With Quote
  #4 (permalink)  
Old 07-16-06, 03:00 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Try this.

Code:
border: solid 1px #000000;
Reply With Quote
  #5 (permalink)  
Old 07-16-06, 03:04 PM
Frogger Frogger is offline
Wannabe Coder
 
Join Date: Jul 2006
Posts: 149
Thanks: 5
Thanked 0 Times in 0 Posts
Thanks but didnt work either. Seems like dowpdowns do not work with IE.
Reply With Quote
  #6 (permalink)  
Old 07-16-06, 05:00 PM
jfulton's Avatar
jfulton jfulton is offline
Community VIP
 
Join Date: Apr 2006
Location: Los Angeles, CA
Posts: 660
Thanks: 0
Thanked 0 Times in 0 Posts
I'm not sure about IE, but I know that at least Safari and Opera don't do well styling forms. I believe it's because the form elements actually come from the OS rather than the web browser. That is definitely how Safari works. I could be wrong, but that's my understanding of it.
Reply With Quote
  #7 (permalink)  
Old 07-29-06, 05:41 PM
GoldenDragon's Avatar
GoldenDragon GoldenDragon is offline
Newbie Coder
 
Join Date: Jul 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
I don't know if this works but I wouls try to add this code to the CSS:
Code:
border-collapse: collapse;
I just remembered that I could have used that trick. Try.
(at least you won't lose anything.)
Reply With Quote
  #8 (permalink)  
Old 07-29-06, 06:09 PM
jfulton's Avatar
jfulton jfulton is offline
Community VIP
 
Join Date: Apr 2006
Location: Los Angeles, CA
Posts: 660
Thanks: 0
Thanked 0 Times in 0 Posts
I don't think I've posted this before, but here's a fairly decent javascript to style your selects .
Reply With Quote
  #9 (permalink)  
Old 07-30-06, 02:42 PM
Frogger Frogger is offline
Wannabe Coder
 
Join Date: Jul 2006
Posts: 149
Thanks: 5
Thanked 0 Times in 0 Posts
Thanks for the border-collapse: collapse; idea but didnt seem to work either. I think now slect boxers are untouchable unless you use some decent javascript like jfulton supplied. Thanks very much for your help.

Frogger
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS inspiration webzen CSS 3 03-05-08 02:47 AM
Arrays and Dropdown Boxes dpeters ASP 8 06-28-06 09:49 AM
Disable Dropdown Boxes radarman012000 JavaScript 8 12-17-04 01:06 PM
dropdown boxes reveals text Squid44th PHP 0 03-22-04 07:27 AM
Execute javascript function based on selected dropdown list value. TKOEHN5751 JavaScript 2 03-14-04 12:13 AM


All times are GMT -5. The time now is 01:52 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.