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:

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