What does > in CSS mean?

前端 未结 4 1454
醉话见心
醉话见心 2021-02-01 06:00

In the IUI css file, they use the following selectors:

body > *:not(.toolbar)
body > *[selected=\"true\"] 

What does the >, *:not() and *

4条回答
  •  孤街浪徒
    2021-02-01 06:32

    > means "is a child element of". So body > *:not(.toolbar) matches *:not(.toolbar) that is a child of body.

    *:not(.toolbar) matches any element that does not have the class .toolbar.

    *[selected="true"] matches any element with the selected attribute equal to true.

    Keep in mind that the last two (*:not() and *[] are part of the CSS3 spec and you usually can't rely on them for cross-browser CSS compatibility. They are, however, fully supported in WebKit which is what the iPhone (and consequently iUI) use.

提交回复
热议问题