Apply different browser based CSS width property? (IE8, FF)
I need to apply width to div. The width value must be changed in the browser. I am unable to apply the conditional css. So there could be any hack for this.
FF
.apply{
width: 720px;
}
IE8
.apply{
width: 690px;
}
Is it possible to combine them with some kind of hack so that the corresponding properties are applied automatically according to the browser.
+3
source to share
4 answers
Apply browser based CSS classes like FF and IE and IE Edge. Use below example css code.
/* This is for Firefox Browser */
@-moz-document url-prefix() {
.divColor {
color: red;
}
}
/* This is for IE Browser */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
.divColor {
color: blue;
}
}
/* This is for IE Edge Browser */
@supports (-ms-ime-align:auto) {
.divColor {
color: green;
}
}
0
source to share