So then this is one that also works but not 'Chrome-only' which is why I did not put it here. You still have to separate it by a Safari-only hack to complete the process. I have created css hacks to do this however, not to worry. Here are a few of them, starting with the simplest. Hack 2: For Google Chrome and OperaChrome. All hacks with brackets i found testing lot of css in google chrome and other browsers so if you are blogging about it please give link to this site or to mynthon.net.
Ie Hack Css
according to this article, I can use the following css rule in order to specify different code for different versions of Chrome browsers.
.chromexx
– Chrome xx (change xx with number of specific version) newAt this point, I was wondering, is this a bad approach?
or should I create another css property like this:
In both examples, the code is working and I prefere the first version in order to avoid making another set of
css
but is that a good approach of using thiscss
rule? ThanksWhy reinvent the wheel?
because the plugin fix the wp admin menu problem in v45 (I just tried that solution) not the described issue :)
My mistake, I was under the impression that was what you were trying to fix!
- Posts
- The forum ‘Other’ is closed to new topics and replies.
Disable Css Chrome
I can't test it on safari/mac but Safari and Google Chrome uses WebKit rendering engine so it is very likely that every hack works in Safari. |
Google Chrome is rather new player but it rapidly increases and there is a need for using specific styles only for that browser. Thats why i am looking for hack for Google Chrome. |
Hack 1: @media and -webkit-min-device-pixel-ratio |
Testsuite: This text is red in Google Chrome. |
This hack uses webkit specific feature. |
/* will be red only in google chrome */ |
#test1{color:green;} |
@media screen and (-webkit-min-device-pixel-ratio:0) { |
#test1{color:red;} |
} |
Hack 2: For Google Chrome and Opera<10 |
Testsuite: This text is red in Opera<10 and Google Chrome. |
All hacks with brackets i found testing lot of css in google chrome and other browsers so if you are blogging about it please give link to this site or to mynthon.net. |
This hack uses bracket hack. When you open bracket only Google Chrome and Opera will stop processing this line on semicolon. Other browsers will ignore any code after opened bracket until closing bracket will be found. It is important to close bracket or any code after opening bracket will be ignored. It is also important to put semicolon (;) at the end of first line of the hack! |
/* will be red only in opera and google chrome */ |
#test2{ |
color:green; |
-bracket-:hack(; |
color:red; |
); |
} |
Hack 3: For Google Chrome |
Testsuite: This text is red in Google Chrome. |
This hack is similar to 'Hack 2' but it works only in Google Chrome. You have to start line with round bracket to make it work. |
/* will be red only in google chrome */ |
#test3{ |
color:green; |
(-bracket-:hack; |
color:red; |
); |
} |
Hack 4: For Google Chrome |
Testsuite: This text is red in Google Chrome. |
This hack is similar to 'Hack 2' but it works only in Google Chrome. If you replace round brackets with square brackets this hack will work only in Google Chrome. |
/* will be red only in google chrome */ |
#test4{ |
color:green; |
-bracket-:hack[; |
color:red; |
]; |
} |