PHP/HTML/CSS - If FireFox, If Chrome, If Safari

后端 未结 4 550
迷失自我
迷失自我 2021-02-04 07:32

Is there a simple conditional statement, css command, html, jquery, javascript or simple PHP dynamic way of detecting the current browser?


           


        
4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-04 07:51

    To do this with CSS only.

    You can target Firefox with this 'hack':

    @-moz-document url-prefix() {...}
    

    And Chrome & Safari together like this:

    @media screen and (-webkit-min-device-pixel-ratio:0) {...}
    

    But not necessarily recommended...

提交回复
热议问题