Modernizr

  1. Respond to your user’s browser features.

  2. Modernizr tells you what HTML, CSS and JavaScript features the user’s browser has to offer.

  3. It’s a collection of superfast tests – or “detects” as we like to call them – which run as your web page loads, then you can use the results to tailor the experience to the user.
  4. All web developers come up against differences between browsers and devices. That’s largely due to different feature sets: the latest versions of the popular browsers can do some awesome things which older browsers can’t – but we still have to support the older ones.web

    Modernizr makes it easy to deliver tiered experiences: make use of the latest and greatest features in browsers which support them, without leaving less fortunate users high and dry.浏览器

  5. Modernizr:专为HTML5和CSS3开发的功能检测类库

    Modernizr是一个开源的JS库,它使得那些基于访客浏览器的不一样(指对新标准支持性的差别)而开发不一样级别体验的设计师的工做变得更为简 单。它使得设计师能够在支持HTML5和CSS3的浏览器中充分利用HTML5和CSS3的特性进行开发,同时又不会牺牲其余不支持这些新技术的浏览器的 控制。less

    当你在网页中嵌入Modernizr的脚本时,它会检测当前浏览器是否支持CSS3的特性,好比 @font-face、border-radius、 border-image、box-shadow、rgba() 等,同时也会检测是否支持HTML5的特性——好比audio、video、本地储存、和新的 <input>标签的类型和属性等。在获取到这些信息的基础上,你能够在那些支持这些功能的浏览器上使用它们,来决定是否建立一个基于JS的 fallback,或者对那些不支持的浏览器进行简单的优雅降级。另外,Modernizr还能够令IE支持对HTML5的元素应用CSS样式,这样开发 者就能够当即使用这些更富有语义化的标签了。ide

相关文章
相关标签/搜索