RandyLahey RandyLahey - 10 months ago 41
CSS Question

CSS: How to target all elements within a given ID

Instead of doing the following to give a text color to all elements on the page:

* {color: red;}

Is there a way to only apply it to all elements within a certain id? Something like this:

#container * {color: red;}

Answer Source

Actually yes, exactly like you mentioned.

#container * { color: red; }