Modernizr 如何做边框半径

发布于 2024-12-14 14:01:39 字数 180 浏览 1 评论 0原文

您能否让我了解一下 Modernizr

如果我使用某个功能(例如,border-radius)并使用较旧的浏览器运行它。现代化者是否会自动将 css 添加到页面,或者我应该编写代码来呈现控件以使其看起来像有边框一样。如果第二种情况属实,那么我为什么要使用 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

南街女流氓 2024-12-21 14:01:39

Modernizr 为您提供了测试 HTML5 支持的主要方法,然后加载您所缺少的内容的垫片,以便您可以按照一种现代标准进行编码。它不会更新浏览器的本机行为。因此,对于 CSS,虽然它会检测您的浏览器是否支持边框半径,但它并没有找到模拟该支持的方法。

然而,它允许您决定加载一些东西来支持它们,例如 css3 pie

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.

高速公鹿 2024-12-21 14:01:39

Modernizr 可以让您检测浏览器是否支持特定功能(例如边框半径)。如果不支持,您可以使用 Modernizr.load() 加载模仿该浏览器功能的填充程序。这允许现代浏览器使用其内置功能(速度会更快),并允许您仅在需要它的浏览器上加载polyfill。

有关 Modernizr.load 的更多信息: http://www.modernizr.com/docs/#load

有用的 polyfill 列表:<一href="https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills">https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills

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.com/docs/#load

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文