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> Link to comment https://forums.phpfreaks.com/topic/183326-strange-css-behaviour/ 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 Link to comment https://forums.phpfreaks.com/topic/183326-strange-css-behaviour/#findComment-967727 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 Link to comment https://forums.phpfreaks.com/topic/183326-strange-css-behaviour/#findComment-967734 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! Link to comment https://forums.phpfreaks.com/topic/183326-strange-css-behaviour/#findComment-967747 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. Link to comment https://forums.phpfreaks.com/topic/183326-strange-css-behaviour/#findComment-967974 Share on other sites More sharing options...
lindm Posted November 30, 2009 Author Share Posted November 30, 2009 Got it! Link to comment https://forums.phpfreaks.com/topic/183326-strange-css-behaviour/#findComment-968321 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.