What is the replacement for the child selector?

后端 未结 8 869
庸人自扰
庸人自扰 2021-02-06 02:57

Since IE6 does not support the child selector (see http://kimblim.dk/csstest/#ex1), what is the alternative when dealing with this browser?

I do not want to modify the m

8条回答
  •  北海茫月
    2021-02-06 03:40

    A cross-browser solution that I have used is the following. It doesn't use IE6 hacks and displays embedded lists correctly (say you need to style OL and UL nested items differently).

    ul, ol {
        /* Set margins, padding, and other generic styles */
    }
    ul li, ul ul li, ol ul li {
        list-style-type: disc; /* unordered lists */
    }
    ol li, ul ol li, ol ol li {
        list-style-type: decimal; /* ordered lists */
    }

    It's as easy as yodeling CSS!

提交回复
热议问题