You can use a number of CSS browser selector “hacks” by checking Browser CSS Hacks by Paul Irish. I’ve posted the available selectors below:
Selector Hacks
/* IE6 and below */
* html #id { color: red }
/* IE7 */
*:first-child+html #id { color: red }
/* IE7, FF, Saf, Opera */
html>body #id { color: red }
/* IE8, FF, Saf, Opera (Everything but IE 6,7) */
html>/**/body #id { color: red }
/* Opera 9.27 and below, Safari 2 */
html:first-child #id { color: red }
/* Safari 2-3 */
html[xmlns*=""] body:last-child #id { color: red }
/* Safari 3+, Chrome 1+, Opera 9+, FF 3.5+ */
body:nth-of-type(1) #id { color: red }
/* Safari 3+, Chrome 1+, Opera 9+, FF 3.5+ */
body:first-of-type #id { color: red }
/* Safari 3+, Chrome 1+ */
@media screen and (-webkit-min-device-pixel-ratio:0) {
#id { color: red }
}
/* iPhone / mobile webkit */
@media screen and (max-device-width: 480px) {
#id { color: red }
}
/* Safari 2 - 3.1 */
html[xmlns*=""]:root #id { color: red }
/* Safari 2 - 3.1, Opera 9.25 */
*|html[xmlns*=""] #id { color: red }
/* Everything but IE6-8 */
:root *> #id { color: red }
/* IE7 */
*+html #id { color: red }
/* IE 10+ */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
#id { color: red; }
}
/* Firefox only. 1+ */
#id, x:-moz-any-link { color: red }
/* Firefox 3.0+ */
#id, x:-moz-any-link, x:default { color: red }
/* FF 3.5+ */
body:not(:-moz-handler-blocked) #id { color: red; }
Attribute Hacks
/* IE6 */
#id { _color: blue }
/* IE6, IE7 */
#id { *color: blue; /* or #color: blue */ }
/* Everything but IE6 */
#id { color/**/: blue }
/* IE6, IE7, IE8, but also IE9 in some cases :( */
#id { color: blue\9; }
/* IE7, IE8 */
#id { color/*\**/: blue\9; }
/* IE6, IE7 -- acts as an !important */
#id { color: blue !ie; } /* string after ! can be anything */
/* IE8, IE9 */
#id {color: blue\0/;} /* must go at the END of all rules */
/* IE9, IE10 */
@media screen and (min-width:0\0) {
#id { color: red}
}
Firefox Specifically
/* Firefox only. 1+ */
#id, x:-moz-any-link { color: red }
/* Firefox 3.0+ */
#id, x:-moz-any-link, x:default { color: red }
/* FF 3.5+ */
body:not(:-moz-handler-blocked) #id { color: red; }
solved can you change content of a website for each broswer using media query?