I have below CSS code in my CSS class.
.ie8 html, body {
padding-left: 140px;
}
html, body {
padding-left: 0px;
}
Here html,body is the last entry. So, for ie8, html, body is getting applied.
Now, if I swap them, then .ie8 html, body will be the last entry. So, for Chrome and FF, .ie8 attributes are getting applied.
CSS file is referred externally from web server.
How to solve this?
As Musa says,
.ie8 html, bodywill apply to two distinct things:htmlelement that is under classie8element (which probably does not exist, sincehtmlshould be the top element)bodyelement (ie8class selector does apply here).Thus, you have two rules handling
body, and the second one overwrites the first. If you switch them around, the effect changes. You probably wanthtml.ie8 body, or.ie8 body(for justbodyelement), orhtml.ie8, html.ie8 body, or.ie8, .ie8 body(for bothhtmlandbodyelements).