Friday, May 11, 2012

Mozilla and Chrome Specific CSS

Hi All,

To add Mozilla specific CSS, just include the CSS inside @-moz-document url-prefix() as shown below:

/* Mozilla Specific CSS */
 @-moz-document url-prefix()  {
    #imgHeaderTD
    {
        display:none;
    }
}

The above code hides the element with ID imgHeaderTD in Mozilla only.

To add Chrome specific CSS, just include the CSS inside  @media screen and (-webkit-min-device-pixel-ratio:0):

/* Chrome Specific CSS */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    #imgHeaderTD
    {
    display:none;
    }
}

Thanks.

1 comment: