Topic: CSS DIV>.inbox
1 - what is mean ">" here
DIV>DIV.block>DIV>.inbox , BODY>DIV>.block2col {BORDER-BOTTOM: 1px solid transparent}
2 - is any way to inherite class and adding some attribute to the new class?
You are not logged in. Please login or register.
PunBB Forums → Programming → CSS DIV>.inbox
1 - what is mean ">" here
DIV>DIV.block>DIV>.inbox , BODY>DIV>.block2col {BORDER-BOTTOM: 1px solid transparent}
2 - is any way to inherite class and adding some attribute to the new class?
The ">" is a child selector. IE doesnt understand it, so it can be used to hide css rules from IE.
dont understand what you mean by #2. Maybe someone else will.
2. I don't think so. You can however assign multiple classes. E.g. <p class="baseclass otherclass">
1 - is
DIV>DIV.block>DIV>.inbox
mean
DIV DIV.block DIV .inbox
2 - maybe we must wait for next version of CSS
I honestly have no idea. I haven't really understood the difference between decendant selectors and child selectors. Here's what W3C says:
At times, authors may want selectors to match an element that is the descendant of another element in the document tree (e.g., "Match those EM elements that are contained by an H1 element"). Descendant selectors express such a relationship in a pattern. A descendant selector is made up of two or more selectors separated by whitespace.
And then child selectors:
A child selector matches when an element is the child of some element. A child selector is made up of two or more selectors separated by ">".
I'm confused.
They're very similar but child selectors are more specific. If we're working with the following markup...
<p>This is a <em>test</em>.</p>
<p>This is <i>a <em>test</em></i>.</p>
...a descendant selector like p em { color:red } would make both instances of the word "test" appear red.
But if we use a child selector like p > em { color:red }, only the first "test" would be red. This is because the first <em> is a direct child of the <p> and the second <em> is a descendant but not a direct child (it's the <p>'s child's child).
Aha! Thanks for clearing that up
PunBB Forums → Programming → CSS DIV>.inbox
Powered by PunBB, supported by Informer Technologies, Inc.