Graphics Programs Reference
In-Depth Information
ol > li { list-style-type : upper-alpha ;}
Figure 2-16: Selecting only the list items that are children of an ordered-list element.
h at greater-than symbol limits the selection to children of ol elements. Take it away, and the
rule will apply to any list item that descends from an ol , even if those are list items in nested
unordered lists (see Figure 2-17).
Figure 2-17: Ordering the unordered.
Yes, that can happen, and no, I didn't cheat. Figure 2-17 is an unordered list with ordered list
markers, and that happened simply because I removed the child combinator.
If you have to support old browsers like IE6 that don't support the child combinatory and you
aren't willing to rely on JavaScript to add support to those browsers (see “IE9.js” in Chapter 1),
then you can simulate child selection via the universal selector.
Let's suppose we want to put a border around any div that's a child of a div with an id of
main (see Figure 2-18). h e child-combinator way is to say:
Search WWH ::

Custom Search