CSS Question: odd use of "child" hack...

User 597929 Photo


Registered User
1,332 posts

In this bit of code:

html>body #content {
height: auto;
min-height: 580px;
}


The body element is always going to be a child of html, so this rule will always be true and #content is available anywhere in the body of the page, right? So what, do you think, was the point of using this syntax instead of just:

body #content {
height: auto;
min-height: 580px;
}


Any ideas? Thanks in advance!
"You can't be a real country unless you have a beer and an airline - it helps if you have some kind of a football team, or some nuclear weapons, but at the very least you need a beer." -- Frank Zappa

Visit Spinland Studios: http://www.spinland.biz
User 463058 Photo


Ambassador
1,086 posts

Not all browsers understand selectors like this, so it is sometimes used to style for those browsers that do understand, but to hide that styling from browsers which don't understand.

Sitepoint's CSS Reference may have more info about this in its section on "filters".
User 463058 Photo


Ambassador
1,086 posts


Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.