Rya*_*pat 9 css css-selectors internet-explorer-6
由于IE6不支持子选择器(请参阅http://kimblim.dk/csstest/#ex1),处理此浏览器时有哪些替代方法?
我不想修改标记,我更喜欢只有CSS的解决方案......
是的,这是我希望定位的直接孩子.
谢谢!
我遇到过一些黑客攻击:http://meyerweb.com/eric/thoughts/2005/05/31/universal-child-replacement/ 使用' star html '黑客入侵IE(6及以下)组合这允许我选择直接孩子.假设我们想要将10px的填充顶部应用于E的直接子F:
* html body E F
{
/* apply style here for IE 6 */
padding-top: 10px;
/* This applies the style to every F inside of E */
}
* html body E * F
{
/* undo style here */
padding-top: 0px;
/* This will undo the style set above for every F that has something in between itself and E, that is, every F besides the direct children of E */
}
Run Code Online (Sandbox Code Playgroud)
到目前为止,我非常感谢您的回复,但我不想接受我自己的回答,这是我最终解决的问题.多谢你们!