html - 如何选择放置在未知级别的元素

标签 html css css-selectors

我有:

<div class=mystyle>
    <input type=checkbox>
    <div>
      <div>  <!---<< the label can be inside here--->
        <div>  <!---<< or here--->
         .....  <<!---< or ????--->
        </div>
       </div>
     </div>

    <div> 
    </div>       
</div>

我有一个 label 元素用于该 input

有没有办法创建一个 css 选择器来选择它(标签),无论它在哪里?

最佳答案

您可以只使用 .mystyle label{} 这适用于您的 mystyle-classed-div 中的每个标签。

关于html - 如何选择放置在未知级别的元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28108680/

相关文章:

html - Angular:如何使用元服务添加或更新元标签以进行 SEO

html - CSS 分页媒体内容问题

html - 背景层元素下层(html/css)

jquery - 如何创建滴答声的逐帧动画外观

html - 使用属性缩放不好吗?

python - 如何通过 Selenium 和 Python 点击​​表中的 onclick 事件

css - 为什么 "a:not(b) > c"无效?

html - nth-of-type 在列表中不起作用

html - iOS 中的两列选择微调器

javascript - 打开lightBox后如何增加图像宽度?