What browsers support CSS #parent > .direct-child notation? (no jQuery)

。_饼干妹妹 提交于 2019-11-30 01:27:13

问题


As far as I know, the > (#test>div) means that the div is required to be a direct child of #test.

Where a space (#test div) means that it can be a descendant/ancestor relationship. So #test p div would be affected by simply a reference to #test div

What browsers support the first one mentioned?


回答1:


You can find information for all selectors at http://www.quirksmode.org/css/contents.html For your questions the supported browsers are the following:

IE 7, IE8, IE9 pr3, FF 3.0, FF 3.5, FF 3.6, FF 4b1, Saf 4.0 Win, Saf 5.0 Win, Chrome 4, Chrome 5, Opera 10.10, Opera 10.53 and Opera 10.60

Edit: Since it's 2015 I would suggest to have as reference for such questions the can I use? website. For example you can find more info for child selector.




回答2:


FF2+, IE7+, Opera/Safari/Chrome ( any modern version of the latter ) should support the child selector.




回答3:


It works great on IE7 (at least) unless you use #div > *, as I've just found out.



来源:https://stackoverflow.com/questions/4159503/what-browsers-support-css-parent-direct-child-notation-no-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!