开发者

Selecting different parts of css selector

开发者 https://www.devze.com 2023-03-11 05:45 出处:网络
Is it possible in a selector like this: div table Select the divs that have been filtered? As in divs that contain a table instead of all tables that a开发者_开发百科re in divs.CSS selectors can no

Is it possible in a selector like this:

div table

Select the divs that have been filtered? As in divs that contain a table instead of all tables that a开发者_开发百科re in divs.


CSS selectors can not ascend. It is one of their limitations.

Also see Does CSS have anything like jQuery's :has()?


No, but you can normally solve this problem with adding classes to your div elements, to help differentiate them from other divs.


This can however be done with Jquery with .parent() .parents() or :parentMight be something work checking out.

0

精彩评论

暂无评论...
验证码 换一张
取 消