What is better: CSS hacks or browser detection?

后端 未结 15 1655
感情败类
感情败类 2020-12-12 15:28

Commonly when I look around the Internet, I find that people are generally using CSS hacks to make their website look the same in all browsers. Personally, I have found this

相关标签:
15条回答
  • 2020-12-12 16:29

    I generally like to have a stylesheet for standards-compliant browsers such as Firefox and Safari and then use conditional comments to detect Internet Explorer and serve it an additional CSS file containing IE-specific fixes and overrides.

    0 讨论(0)
  • 2020-12-12 16:32

    I try not to use either. In a lot of cases the issues that IE have can be avoided by simplifying the structure of your markup somewhat.

    It also helps if you use a decent CSS reset like Eric Meyer's.

    I am also slowly but surely dropping support for IE6 as a matter of principle, especially given the latest security issues with IE6 and IE7 - we're not going to change people's browsing habits and browser preferences if we keep supporting crappy browsers.

    0 讨论(0)
  • 2020-12-12 16:32

    [My approach][1] using a PHP class to detect os, browser and browser version.

    [1]: My approach using a PHP class to detect os, browser and browser version http://reinholdweber.com/css/css-hacks-browser-version-detection-a-new-approach/

    0 讨论(0)
提交回复
热议问题