CSS: How to target all elements within a given ID


Tags: css

Problem :

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;}


Solution :

Actually yes, exactly like you mentioned.

#container * { color: red; }

    CSS Howto..

    How can I add CSS and JS in Symfony2?

    CSS: how to get two floating divs inside another div

    How to make rounded tabs with css? [closed]

    How to change element properties on hover with CSS in following case

    How to avoid background image stretched horizontally with CSS?

    How to remove default CSS from TextField in flex?

    How to toggle the sidebar menu for every browser size?

    How do I remove the side padding in the following case?

    How to change font of select list items in the drop down

    How do I center a menu option under it's heading option in a drop down menu?

    How to optimize this css code? [closed]

    How can I make DIV 100% height of browser without vertical scrolling of header

    Google chart - how to change a css property for the whole table

    How do I fix the navigation menu in Firefox and Internet Explorer?

    How to make an element have a 'hover' effect (CSS) while hovering another element using jQuery?

    How to create a clickable block?

    100% width = viewport width. How to make it as wide as is page body instead?

    How CSS Positions work, why absolute elements stack up on each other instead of stacking one after other

    How can I center an unknown number of block elements of unknown widths in a block container of an unknown width?

    How to show indicator of loading?

    how to size the silverlight object to available space

    How to make a block element adjust to the size of what is inside it?

    How to make jQuery show() stay on page

    How do I resize a div relative to browser window size?

    How do I get my textboxes to align properly once triggered? - jQuery/CSS

    how to align the content of a box

    How do I make my React Components to be responsive via css media queries?

    How to stop Visual Studio css intellisense breaking when css is added via a custom control

    How to add a margin to a paragraph?

    How can I prevent IE from displaying a website? [closed]