【问题标题】:Css Selector, Select only the father of a particular child [duplicate]Css Selector,仅选择特定孩子的父亲[重复]
【发布时间】:2015-03-04 05:43:59
【问题描述】:
 <h1>
        <span class="teste">
            Conteúdo Teste
        </span>
    </h1>

我无法修改 HTML。必须仅在 h1 中输入 css 属性,该属性的跨度为 .我该怎么做?

【问题讨论】:

标签: css css-selectors


【解决方案1】:

无法在 CSS 中选择父级。

【讨论】:

    【解决方案2】:

    我错了。看看这个..

    Is there a CSS parent selector?

    【讨论】:

    • 这不是针对&lt;h1&gt;,而是针对&lt;h1&gt;内的&lt;span class="teste"&gt;
    猜你喜欢
    • 1970-01-01
    • 2010-09-07
    相关资源
    最近更新 更多