Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Stlying HTML Element

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #25578
    jlmpres
    Member

    I recently read an article that talked about applying style rules directly to the HTML element (font, background, etc.). The article then cited how the author uses the BODY element to replace the oh-so-common "wrapper" div. Is there any peril to applying styles to the HTML element? Do any browsers choke or fail to display styles applied in the HTML element?

    #61357
    jlmpres
    Member

    ikthius, Thanks for the welcome.

    I don’t think I was clear with my first post. I am talking about using css. Here’s a code block that should make my question a little clearer:

    html {
    background: #333 url(someimage.jpg) repeat-x top left;
    font: normal 1.2/1 arial, serif;
    }

    body {
    background: #fff;
    width: 950px;
    }

    My question is if anyone knows of any issues with support in any of the major browsers when applying these style rules directly to the html tag (element). I hope this is more clearly stated now.

    My biggest concern would be absolutely positioning the body element in this case. Normally I set the parent of any position: absolute element to position: relative. In this case that would be the html element and I wonder if this causes any browsers to have display issues (or any other related issues to styles in the html element).

    #61386
    Rob MacKay
    Participant

    you can style the HTML and BODY tag as you like. just don’t set them to height:10px; overflow:hidden; ;)

    #61389
    jlmpres
    Member

    Thanks so much apostrophe, I thought there might be some issues such as the ones outlined in that post. This was very informative and helped a lot. I don’t think I’m going to give up my trusty "wrapper" div just yet. :)

    "apostrophe" wrote:
    I knew I had read this somewhere but it took me a while to track it down http://www.sitepoint.com/blogs/2009/02/11/styling-the-html-and-body-elements/
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.