What is better: CSS hacks or browser detection?

后端 未结 15 1703
感情败类
感情败类 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:15

    Listen to your code! Kent Beck says it. And in Wing-Tsun they say: be like the water that bends! Or something.

    Look, here's a CSS Hack to get IE5 to understand html5: http://blog.whatwg.org/styling-ie-noscript.

    And here's the same using JS: http://blog.whatwg.org/supporting-new-elements-in-ie.

    Compare 5 pages of hack explanation with 5 lines of well-understandable code. So, use JS.

    Things have their benefits and their downsides. And your understanding of the matter and the elegance of the actual code lead the way.

提交回复
热议问题