Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question xhtml, html, css and background-color

    Consider the following:

    https://my.ryerson.ca/bbcswebdav/users/m4yip/index.html
    vs
    https://my.ryerson.ca/bbcswebdav/use...ip/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/use...p/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

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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
    Code:
    html {
           background-color:#000000;
           color:#ffffff;
    }


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •