magnetica Posted August 15, 2009 Share Posted August 15, 2009 Hi simple question. I'm setting a background color on a div and when I put the <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> the background color disappears? Whys this? Thanks Quote Link to comment Share on other sites More sharing options...
magnetica Posted August 15, 2009 Author Share Posted August 15, 2009 Sorry heres the css: #content { width: 795px; background-color: f9dc6e; margin: 0px; padding: 10px; } Quote Link to comment Share on other sites More sharing options...
DEVILofDARKNESS Posted August 15, 2009 Share Posted August 15, 2009 I also had problems with the doctypes, I simply solved this by using this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> Quote Link to comment Share on other sites More sharing options...
magnetica Posted August 15, 2009 Author Share Posted August 15, 2009 Simple as that sometimes. Thanks Quote Link to comment Share on other sites More sharing options...
haku Posted August 17, 2009 Share Posted August 17, 2009 Your problem was here: background-color: f9dc6e; Should be: background-color: #f9dc6e; The doctype just meant that the browser started checking it by rules, and you were breaking the rules by not having the pound sign (#) in front of the hexidecimal code, so it stopped displaying 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.