Wednesday 18 December 2019

html - CSS unknown number of intermediate elements

I have a DOM tree which looks something like this (formulated as a regex):



div.container (div.notbox | div.box)+


Now I need so select all "first-level" .box children. Lets assume following document:














In this case I would need to select #1 and #3, but not #2.

Is there a way to formulate that with a CSS query? Something like



.container > :not(.box) > .box


but repeat the :not(.box) clause an indefinite amount of times?

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...