About Logical CSS Selectors

In CSS you can combine the :is() and :not() pseudo classes to filter or filter out elements that belong or don't belong to a certain container:

1
2
3
4
5
6
7
8
9
img:is(.content *) {
    /* analogous to `.content img` */
    max-width: 100%;
}

img:not(.content *) {
    /* all <img>s that are not within .content */
    max-width: none;
}

Tips and Tricks Programming Web Design CSS3