...

View Full Version : xhtml, html, css and background-color



aznrocket
12-21-2005, 04:40 AM
Consider the following:

https://my.ryerson.ca/bbcswebdav/users/m4yip/index.html
vs
https://my.ryerson.ca/bbcswebdav/users/m4yip/index.xhtml

Why does the latter have a white background, whereas the former doesn't?

They both use the same css, https://my.ryerson.ca/bbcswebdav/users/m4yip/engstyle.css , and the source of both documents are the same ...

What's wrong, and how do I go about getting the xhtml document looking like the html one?

Thanks

_Aerospace_Eng_
12-21-2005, 07:18 AM
When using XHTML the default background color needs to be applied to both the html and body elements. IE doesn't think html is even a tag so it doesn't understand the color in there, but it does in the body, the parent element in XHTML is where the background color should be, add this to your CSS

html {
background-color:#000000;
color:#ffffff;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum