Drupal 7 Browser specific css

前端 未结 3 537
灰色年华
灰色年华 2021-01-03 12:18

How can i have a browser specific css in Drupal 7 . I would like to load chrome.css if browser is chrome . Please help

3条回答
  •  粉色の甜心
    2021-01-03 12:44

    I recommend using the Conditional Stylesheets module

    Internet Explorer implements a proprietary technology called Conditional Comments. While web developers frown upon technologies that aren't cross-browser supported, many CSS developers have found Conditional Comments very useful. They can have cleaner CSS in their normal stylesheets and can fix the broken rendering in IE by placing IE-only CSS inside conditional comments; this technique is even recommended by Microsoft. Without this module, the only way to have IE conditional stylesheets was to add 37 lines of code (more if you want to add more than one stylesheet) in four horribly-difficult-to-remember function calls to your theme's template.php. Blech. Who wants that?

提交回复
热议问题