I am using css media queries in my main css file for printing some page elements. Here is the sample code
body *
    {
        visibility: hidden;
        background: #FFF;      
        margin: 0px;
        padding: 0px;
    }
    #Grid *
    {
        visibility: visible;
    }
But my application is huge and I don't want this to affect the existing functionality. So I only want this css to apply on the pages where <Div> element with id <Grid> exists also writing this in other css file and using in each page would be very time consuming as I need this functionality on about 80 pages.Is there any way to select all body elements where div with id Grid exits in a single css file for all the application ? I am  thinking of something like 
body [div="Grid"] * {}
but unfortunately this doesn't works.
 
     
     
    