Forums

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

Home Forums CSS Body and class works only sticked together Re: Body and class works only sticked together

#114405
Paulie_D
Member

That presence or lack of a single space between the (body) element and the class selection symbol (.) causes two different selections to occur. No space means the style will apply to elements which are themselves marked with that class navbar.

A single space means the style will apply to elements within the element which themselves are marked with the class.

So, in your case, AS I UNDERSTAND IT

body .node-type-foo
would apply to an element with a class of .node-type-foo if it was INSIDE the body which it isn’t because it’s the whole page.

body.node-type-foo
will work because the class is being applied TO the body.

Is that it?