How do I select the <li>
element that is a direct parent of the anchor element?
(如何选择作为锚元素直接父元素的<li>
元素?)
As an example, my CSS would be something like this:
(例如,我的CSS将是这样的:)
li < a.active {
property: value;
}
Obviously there are ways of doing this with JavaScript, but I'm hoping that there is some sort of workaround that exists native to CSS Level 2.
(显然,可以使用JavaScript进行此操作,但是我希望CSS Level 2本身具有某种解决方法。)
The menu that I am trying to style is being spewed out by a CMS, so I can't move the active element to the <li>
element... (unless I theme the menu creation module which I'd rather not do).
(我尝试设置样式的菜单已由CMS弹出,因此我无法将active元素移至<li>
元素...(除非我将菜单创建模块作为主题,但我不希望这样做) 。)
Any ideas?
(有任何想法吗?)
ask by jcuenod translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…