RandyLahey RandyLahey - 1 month ago 9
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

Actually yes, exactly like you mentioned.

#container * { color: red; }
Comments