Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How set CSS in All Browser Compatiblity?

Tags:

html

css

How do I set CSS only for IE 7, 8 and 9?

.pager .pages { margin:4px 0px 0 0; float:right; }

The above class is not displayed in IE 7 and 8. So the design is not properly displayed.

like image 952
Naitik Mistry Avatar asked Oct 05 '22 22:10

Naitik Mistry


2 Answers

Put your css in a seperate .css file and add this to the end of your <head>

<!--[if gt IE7]>
    <link rel="stylesheet" type="text/css" href="ie-only.css" />
<![endif]-->

More info about conditional loading of css files here: http://css-tricks.com/how-to-create-an-ie-only-stylesheet/

like image 142
Damien Overeem Avatar answered Oct 10 '22 02:10

Damien Overeem


Hello Naitik try following css.

For IE7:

    @media screen\9 {
    .pager .pages {
     margin:4px 0px 0 0; 
     float:right; 
    }
    }

    For IE8:

    @media \0screen{
   .pager .pages {
    {
    margin:4px 0px 0 0;
    float:right;
    }
    }

    For IE9:

    @media all and (min-width:0) {
    .pager .pages {
     margin:4px 0px 0 0; 
     float:right; ;
    }
    }
like image 29
Jimmy Avatar answered Oct 10 '22 02:10

Jimmy