css - 如何通过使用 css 选择器从父 div 访问子 div 来为子 div 应用不显示
问题描述
我正在为我使用 Css,代码变得动态,所以有人可以解释如何通过使用 css 选择器访问父 div 来为子 div 应用 display none。对我来说,代码是动态的,所以我是代码的形象
所以从我的代码中,如何为这个 div 应用 display none --->
<div class="jsx-674079454 topbar"></div>
所以我对 Image 的问题是为了更好地理解。
如果您有任何问题,请告诉我。
解决方案
第一种方法是最简单的直接使用类如:
.topbar {
display: none;
}
<div id='_next'>
<div class='randomoijosj'>
<div class='randomoijokpokpokosj call'>
<div class='randomoijosjytfty topbar'>hideme</div>
<div class='randomoijosjtyf main'></div>
</div>
</div>
</div>
或者您可以使用>
如下选择器:
#_next>div>div>div {
display: none;
}
<div id='_next'>
<div class='randomoijosj'>
<div class='randomoijokpokpokosj call'>
<div class='randomoijosjytfty topbar'>hideme</div>
<div class='randomoijosjtyf main'></div>
</div>
</div>
</div>
推荐阅读
- php - 如何从 WooCommerce 客户感谢电子邮件中删除字段(客户处理订单)
- delphi - 如何使用 DBLookupComboBox 在 Delphi 中的表单页面之间移动
- r - 错误 - cocor 中的变量必须是数字
- java - Grails Spring Security 中的 AbstractMethodError
- javascript - 如何在 node.js 中使用startsWith?
- c# - 序列化派生类时如何让xml数据合同序列化程序忽略基类属性
- c++ - mongo-cxx 驱动程序找不到 unique_ptr 的 polyfill
- r - 从浏览器的目录中查看保存的 LDAvis 图
- python - 尝试在 Python 中运行使用 Sage Math 的代码时出现 NameError 和 AttributeError
- html - element.style 和 element.setAttribute(attribute, value) 不一样?