lindm Posted November 29, 2009 Share Posted November 29, 2009 The following setup gives the text field the color I want (FF99FF): <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> <style type="text/css"> .fb {background-color:#CCC;} .c {background-color: #FF99FF} </style> </head> <body> <input type="text" name="test" id="test" class="fb c"/> </body> </html> The setup I need to use does however not (changed .fb to input|type="text"])..anyone know why? <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> <style type="text/css"> input[type="text"] {background-color:#CCC;} .c {background-color: #FF99FF} </style> </head> <body> <input type="text" name="test" id="test" class="fb c"/> </body> </html> Quote Link to comment Share on other sites More sharing options...
FaT3oYCG Posted November 29, 2009 Share Posted November 29, 2009 because that isnt css? color:#CCC; would change the font colour Quote Link to comment Share on other sites More sharing options...
lindm Posted November 29, 2009 Author Share Posted November 29, 2009 The effect is the same with #CCCCCC. THe problem is that the css rule input[type=text] {background-color:#CCC;} seems to prevent the .c class from having effect Quote Link to comment Share on other sites More sharing options...
FaT3oYCG Posted November 29, 2009 Share Posted November 29, 2009 As I said input[type=text] isn't css! Quote Link to comment Share on other sites More sharing options...
haku Posted November 30, 2009 Share Posted November 30, 2009 It's CSS, but it's CSS3, which isn't supported by many browsers at the moment. I'm not sure if that particular selector is supported or not in any browsers, but it's definitely not supported in all browsers. Quote Link to comment Share on other sites More sharing options...
lindm Posted November 30, 2009 Author Share Posted November 30, 2009 Got it! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.