http://www.webmasterworld.com Welcome to WebmasterWorld Guest from 38.103.63.17
register, login, search, glossary, subscribe, help, library, PubCon, announcements , recent posts, unanswered posts
Subscribe to WebmasterWorld
Home / Forums Index / Browser Side World / CSS
Forum Library : Charter : Moderators: DrDoc & Robin reala & SuzyUK

CSS

  
Explanation of these CSS definitions: *:first-child+html
AffiliateDreamer


#:3620065
 9:33 pm on April 5, 2008 (utc 0)

Hi,

Can someone explain what these CSS defintions mean?

*:first-child+html #nav ul li
{ padding-bottom: 5px; }

I'm not sure what the '*' means, or the : or the +

coopster


#:3620091
 11:06 pm on April 5, 2008 (utc 0)

Here you go, see if the Selectors docs clarify things.

swa66


#:3620220
 8:38 am on April 6, 2008 (utc 0)

Feels very much like a hack. I'd stay clear of it.

html is your outermost element, talking about it in terms of a sibling can't be done equally in many browsers, on top of that, siblings themselves are already not supported by e.g. IE6

  • * : any element used e.g. to reset padding and borders globally
  • :first-child : only matches the first sibling in a parent, I've used it in
  • + : sibling selector: matches the second one if immediately preceded by the first one

londrum


#:3620286
 1:25 pm on April 6, 2008 (utc 0)

it's a hack for IE7. only IE7 will pay any attention to the rule.
a bit like
* html, which we used for IE6.

it's quite handy though - i use it.

swa66


#:3620515
 11:13 pm on April 6, 2008 (utc 0)

I will always use conditional comments instead of hacks to do specific stuff for the broken IE6 and IE7. Hacks come back and haunt you in the long term.

Wlauzon


#:3647629
 3:55 am on May 12, 2008 (utc 0)

This is a CSS hack for IE7 only, but I have yet to figure out the purpose of it, or what it does different.

For example, our Yahoo store default css used:
*:first-child+html #bodyshell { width:610px; }

But this seems to have the same effect and works also:

#bodycontent #messagearea {
border: 1px solid #FF00FF;
width: 90%;
margin: 0 auto;
font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 1.2em;
}

Since #messagearea is a descendant of #bodycontent.

I can only test this in IE7 and FF - am I missing something?

 

Home / Forums Index / Browser Side World / CSS
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
WebmasterWorld ® and PubCon ® are a Registered Trademarks of WebmasterWorld Inc.
© WebmasterWorld Inc. / SearchEngineWorld 1996-2008 all rights reserved