|
|
|
|
|
by seanwilson
15 hours ago
|
|
I was thinking more of a document with multiple paragraphs and images, where some paragraphs are grouped with images and some aren't. In the code from the link, the <body> element is serving as the wrapper element, that gives you a hook to get the layout you want. But when you're not lucky enough to have a semantic wrapper tag like that, you've usually got to add a generic tag help. Or write CSS that's closely coupled with the HTML, so they aren't really separate anyway. |
|
No group HTML: p text /p img img No group CSS: p:has(+ img) {...} p + img {...} p + img + img {...}
Valid, semantic, easy to target.