Jump to content

[SOLVED] Doctype and div bgcolors


magnetica

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.