CSS assign class to child elements that are not a specific type

Suppose I have a DIV element whose id is mydiv.

<div id="mydiv">

I want to assign a CSS class to only those direct descendants of this div that are not span elements. So in the above example the class should be assigned only to the child div and p elements. How do I accomplish this using CSS (not Javascript)?

Source: css

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.