> However, this doesn't allow styling of the parent based on the number of children. Note that `:has` [cannot](https://drafts.csswg.org/selectors-4/#profiles) be used in style rules. It can be used by script: ``` const parents = document.querySelectorAll('a:has(> img)'); for (let parent of parents) { const numChildren = parent.querySelectorAll('* > img').length; if (numChildren > ...) parent.style. ... = ...; else ... } ``` -- GitHub Notification of comment by ewilligers Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1547#issuecomment-445124500 using your GitHub accountReceived on Friday, 7 December 2018 05:09:12 UTC
This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:40 UTC