I have the following DOM layout:
<div style="background-color:rgba(0, 0, 255, 0.2);outline:1px solid red;display:inline">
This should be marked
<div>i want this too</div>
and this too
</div>
I want to style the outer div
that is outlines or colors the background of its whole area, the inner div
included, like in the Chrome devtools if you select a part of the DOM:
My restriction is that I cannot change the styles inside the span
, it has always different children (I can write any CSS to the outer span
though, that doesn't change the position/dimensions). Basically I want to replicate the Chrome devtools DOM highlighter.
How to do this?