SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Member
    Join Date
    Sep 2004
    Location
    dc
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Quirks mode, "HTML" CSS tag

    Could someone explain the purpose of the HTML css tag?

    I've been putting a number of elements in that tag [blindly, because I'm not sure why I'm doing it or why its working when I do], to get certain things to work.

    Thanks in advance,
    -pstoo

  2. #2
    Winemaster bronze trophy BonRouge's Avatar
    Join Date
    Oct 2004
    Location
    Sendai, Japan
    Posts
    2,417
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The html selector has nothing to do with quirks mode. Did you have a question about quirks mode?

    If you want to use 100% height, you'll need to set the html to 100% height first. Also, you can control the scrollbars (hide them) with the html tag - this can be useful... Take a look at this : http://bonrouge.com/test/fixed.htm. This is one way of getting 'position:fixed' in IE.

  3. #3
    SitePoint Member
    Join Date
    Sep 2004
    Location
    dc
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I thought the HTML tag had something to do with Quirks mode.
    My mistake....

    Thanks for the help. I've never used the HTML tag until the past couple of days, when running into problems. Is this a preference to putting things in the BODY tag? Like scrollbars, or overflow?

    -pstoo

  4. #4
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it's a bit confusing...

    This is an HTML tag (the start tag):
    HTML Code:
    <html lang="en">
    This is also an HTML tag (the end tag):
    HTML Code:
    </html>
    Although it seems like you are talking about using "html" as a selector in CSS:
    Code:
    html {...}
    I don't quite understand the problem. Perhaps you could describe in more detail what you are trying to achieve?
    Simon Pieters

  5. #5
    SitePoint Member
    Join Date
    Sep 2004
    Location
    dc
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, HTML as a "selector". Sorry, my terminology is a bit out of whack.

    I'm just wondering what specifically is the purpose of it?

    I had a site setup with an IFrame, here:
    www.embersofeuphoria.com

    And had to include the HTML selector with 2 properties:
    overflow-x:none;
    and the scrollbar properties.

    It didn't seem to work when I put those properties in the BODY selector [thats where I thought they should have been]. I'm looking for an explanation as to why it worked when I put it in HTML selector and not the BODY selector.

    zcorpan, you're in Sweden? Me too! I've just moved to Stockholm.
    Regards,
    -pstoo

  6. #6
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Another Swede chiming in here:

    The html selector selects the <html> element, which is the 'canvas' of your page.
    Birnam wood is come to Dunsinane

  7. #7
    SitePoint Member
    Join Date
    Sep 2004
    Location
    dc
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool, the weather in Stockholm has been absolutely BEAUTIFUL this past week! I can't believe that 4 months ago everything was covered in SNOW!

    Okay, so it makes sense that it access the HTML element, but why would putting things in this selector in my CSS work, as opposed to putting it in the BODY selector, which I've been doing?

    I've never used the HTML selector [nor did I know it existed] until I had issues with my IFrame not behaving properly [i.e. scrollbars appearing where they shouldn't, or scrollbar colors not working]....
    Putting those properties in the HTML selector instead of the BODY selector solved my problems. I'm just not sure WHY..........

    Thanks!
    -pstoo

  8. #8
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The scrollbar color properties are nonstandard to start with, but for IE5 you need to specify them for the BODY element and for IE6 (in standards mode) you need to specify it for the root element (the HTML element, in other words). So it might be a good idea to specify the properties for both the HTML and the BODY.
    Code:
    html, body {...}
    zcorpan, you're in Sweden? Me too! I've just moved to Stockholm.
    Off Topic:

    We should party!
    Simon Pieters

  9. #9
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The BODY element is 'special' in HTML (but not in XHTML). Certain properties assigned to BODY will automatically propagate to the HTML element as well.

    IE5/Win and IE6 in quirks mode will not allow you to style BODY very much – you can't assign a width to it, IIRC.

    The HTML element represents the entire document, so it's natural (to me) that scroll bar properties belong with HTML.
    Birnam wood is come to Dunsinane

  10. #10
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tommy, I'm not quite sure if that's right. Sertain properties for the BODY element in HTML will be applied to the canvas. The HTML element isn't the canvas.

    Sertain properties for the root element in XML are applied to the canvas.

    ("Sertain properties" are background, overflow and perhaps some others aswell.)
    Simon Pieters

  11. #11
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may be right about that, but the net effect is as if the properties were specified for HTML rather than BODY.
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

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