This is something I feel I should know, but I don't.
When using CSS styles, we can define them like this:
.customClass {}
and if the same style should be applied to more than one class, we separate them with commas, yeah?
.customClass1, .customClass2 {}
However, what about parents and children? CSS2 supports this syntax:
.parentClass>.childClass {}
However as we know, not all browsers support that yet. So, I have always thought that dot or space syntax is the idea (this is where the problem comes in).
I started off thinking that something like this:
.parentClass.childClass {}
was correct notation. However, that caused me some problems in either IE or Mozilla. In the end I changed it by adding a space in between, like this:
.parentClass .childClass {}
Now it strikes me that custom classes start with dots, yeah? So surely standard HTML tags should work without the space, e.g.
p.a {}
But I believe I found problems with that, too.
Applying the same logic to the custom classes:
.parentClass..childClass {}
didn't get me anywhere, and seems odd, too. But I had to try.
What I want to know, is, what is the proper method of defining children? Without using the ">" CSS2 syntax? Because I have seen a few places that use p.a syntax however that doesn't always work for me especially when using custom classes.
Oh and before anyone says about it, yes I looked at the W3C (my first point of call as always) and it didn't help much. I want to know what will work, and work now, in IE6 and Mozilla, but also as far back as possible (does IE6 support ">"? I don't think so...?)
Cheers anyone!
::] krycek [::