child selectorsExplanationCSS1 provided the contextual selector which allows the selection of an element that is a descendent of another selector (that's why in CSS2 these are referred to as descendent selectors). But this doesn't provide as much control as we might like. For example, the selector <div><p>This is the <strong>essence</strong> of the argument</p></div> is selected, as is <div>This is the <strong>essence</strong> of the argument</div> It might be that we only want to select the You might like to think of child selectors as selecting only children, not grandchildren. SyntaxA child selector is formed by listing the parent, then the child element separated by a " <div>This is the <strong>essence</strong> of the argument</div> But it will not select it here, where it is not the child of the <div><p>This is the <strong>essence</strong> of the argument</p></div> More complex selectors can be formed using more than one child. For example UseChild selectors provide even finer control over the selection of elements than that provided by contextual selectors. As with contextual selectors, they don't require any changes to be made to the HTML. Browser supportDetailed browser support information for this feature can be found in the full version of the Westciv CSS Guide, or in our CSS Browser Support Table. next: first child selectors(C)1997-2001 Western Civilisation Pty. Ltd. |