最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Modernizr How to do border-radius - Stack Overflow

programmeradmin3浏览0评论

Could you please make me little bit clear about Modernizr.

If I use a feature (say, border-radius) and I run it using an older browser. Will the modernizer automatically add css to the page OR should I write code to render the control to view like having borders. If the second case is true, then WHY should I use Modernizr?

Could you please make me little bit clear about Modernizr.

If I use a feature (say, border-radius) and I run it using an older browser. Will the modernizer automatically add css to the page OR should I write code to render the control to view like having borders. If the second case is true, then WHY should I use Modernizr?

Share Improve this question asked Nov 11, 2011 at 5:16 RaufRauf 12.9k22 gold badges79 silver badges128 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 9

Modernizr gives you mostly ways to test for HTML5 support, and then load in shims for what you're missing so that you can code to one, modern standard. It doesn't update the browser's native behaviors. So for CSS, while it detects whether or not your browser supports border radius, it doesn't figure out a way to emulate that support.

It would however allow you to decide to load in something to support them like css3 pie.

Modernizr lets you detect if a particular feature (say border-radius) is supported in the browser. If it is not supported, you can use Modernizr.load() to load a polyfill that mimics the functionality on that browser. This allows the modern browsers to use their built-in features (which will be faster) and lets you load the polyfill only on the browsers that need it.

More info on Modernizr.load : http://www.modernizr./docs/#load

Useful list of polyfills : https://github./Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills

发布评论

评论列表(0)

  1. 暂无评论