Different CSS files for Different Browsers

前端 未结 10 1015
情深已故
情深已故 2020-12-17 07:48

I want to use different CSS files for different browser types. Is there any simple HTML code which can detect different types of browsers and include CSS files accordingly?<

10条回答
  •  鱼传尺愫
    2020-12-17 07:55

    you have to use the server side to do that on all browser. If you choose the server side way, you would have to parse the User-Agent header and add the valid CSS from that parsing. I advise you not to do that because User-Agent parsing is a tedious task and there is more elegant way to deal with browser quirks.

    Worth to be noted that if you are interested only adding special CSS rules(files) for Internet explorer there is a special syntax:

    
         
     
    热议问题