“You have a bug in the menu, everything has moved up,” says the customer.
- Looked in all browsers, no! What are you looking at? - says layout designer.
- In firefox.
“Everything is fine there,” says the coder, viewing the site in all versions of firefox.
- There is a bug. If this is important, then I'm with poppy.
var cssFix = function () { var u = navigator.userAgent.toLowerCase (), is = function (t) {return (u.indexOf (t)! = - 1)}; $ ("html"). addClass ([ (! (/ opera | webtv / i.test (u)) && / msie (\ d) /. test (u))? ('ie ie' + RegExp. $ 1) : is ('firefox / 2')? 'gecko ff2' : is ('firefox / 3')? 'gecko ff3' : is ('gecko /')? 'gecko' : is ('opera / 9')? 'opera opera9': / opera (\ d) /. test (u)? 'opera opera' + RegExp. $ 1 : is ('konqueror')? 'konqueror' : is ('applewebkit /')? 'webkit safari' : is ('mozilla /')? 'gecko': '', (is ('x11') || is ('linux'))? ' linux ' : is ('mac')? ' mac ' : is ('win')? ' win ':' ' ] .join ('')); } ();
var cssFix = function () { var u = navigator.userAgent.toLowerCase (), addClass = function (el, val) { if (! el.className) { el.className = val; } else { var newCl = el.className; newCl + = ("" + val); el.className = newCl; } }, is = function (t) {return (u.indexOf (t)! = - 1)}; addClass (document.getElementsByTagName ('html') [0], [ (! (/ opera | webtv / i.test (u)) && / msie (\ d) /. test (u))? ('ie ie' + RegExp. $ 1) : is ('firefox / 2')? 'gecko ff2' : is ('firefox / 3')? 'gecko ff3' : is ('gecko /')? 'gecko' : is ('opera / 9')? 'opera opera9': / opera (\ d) /. test (u)? 'opera opera' + RegExp. $ 1 : is ('konqueror')? 'konqueror' : is ('applewebkit /')? 'webkit safari' : is ('mozilla /')? 'gecko': '', (is ('x11') || is ('linux'))? ' linux ' : is ('mac')? ' mac ' : is ('win')? ' win ':' ' ] .join ("")); } ();
. [OS]. [Browser] css selector
.win - Windows
.linux - Linux
.mac - MacOS
.ie - all versions of IE
.ie8 - IE 8.x
.ie7 - IE 7.x
.ie6 - IE 6.x
.ie5 - IE 5.x
.gecko - all versions of firefox, and other gecko browsers
.ff2 - firefox 2
.ff3 - firefox 3
.opera - all versions of opera
.opera8 - opera 8.x
.opera9 - opera 9.x
.konqueror - konqueror
.safari - safari
.mac.gecko selector {/ * fixed code * /}
or
.mac.ff2 (3) selector {/ * fixed code * /}
.win.ff3 #id {background: #aaa} / * 1 * /
.win.gecko #id {background: # f00} / * 2 * /
.ff3 #id {background: # 333} / * 3 * /
.gecko #id {background: # 00f} / * 4 * /
.win #id {background: # ff0} / * 5 * /
Source: https://habr.com/ru/post/28759/
All Articles