CSS hack for Chrome on Mac only - No JavaScript -

Is there any way to configure Chrome only on Mac ONLY? I used:

@media screen and (-webkit-min-device-pixel-ratio:0) { /* Webkit Styles here */ } 

But this is displayed in both WIN and MAC.

I would be ready to approach from a different angle and to the goal of IE and FF for Mac, only if this is the only option.

I also want to NOT use JavaScript if I can avoid it.

Any ideas?

+4
source share
3 answers

You can't do this with CSS at all, maybe you need to use javascript to do this.

+4
source

What problem are you accessing directly in Chrome on Mac? This is like it might break as soon as Chrome on the Mac refreshes to fix any problem you encounter and the speed with which they distribute updates will be pretty soon. Perhaps you should edit your question so that it asks a question about the original problem you are dealing with, and not the workaround that you are trying to do.

+2
source

You can parse through the PHP variable $_SERVER['HTTP_USER_AGENT'] to detect the browser and OS, and echo browser / OS styles based on your findings. Thus, the corresponding styles are served even if the user does not have enough JavaScript needed to sniff the browser on the client side.

(Of course, viewers swapping their user agents may trick your system into using the wrong CSS, but who cares? It's their user experience, they need to know what they get.)

0
source

Source: https://habr.com/ru/post/1396770/


All Articles