使用不受支持的浏览器[HTML5 / CSS3] [英] Working with unsupported browsers [HTML5/CSS3]

查看:164
本文介绍了使用不受支持的浏览器[HTML5 / CSS3]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,这里,我正在使用一些html5和css3元素,显然不要在某些浏览器上正确加载,我有一些关于我可以做什么的问题,我没有太多经验使用任何代码,如PHP或JavaScript。这些问题也是一团糟 - 我一直在搜索,不知道我应该寻找什么。



我如何去创建一个



我知道我可以使用IE的条件注释,但IE不是唯一不支持的浏览器。是否有办法激活某些元素,或div取决于浏览器?



我如何创建一个将显示的网站版本,而不是不支持版本?



有更好的方法吗?



这些问题可能不是正确的 - 如果没有,你知道我正在寻找的问题的答案,请去吧!谢谢!

解决方案

我会推荐几种工具:



Modernizr



功能检测,允许您定位CSS和JS中的功能。它不添加功能,只是让你测试他们。



包括HTML5shiv功能也做了很多 - 如果你不使用其他功能,然后don不使用它,它会减慢页面加载,但是如果你需要它是值得的。



HTML5shiv



非常小,允许在IE中使用html5元素, >

CSS3PIE



让您在旧版本的IE中使用border-radius,gradients和box shadow。



ie7.js(and ie9.js)



提供许多CSS3选择器,最小和最大宽度,和固定定位。如果你喜欢也可以有一个png修复。似乎不会减慢很多东西。


I have a site, here, that I'm working on which uses some html5 and css3 elements which obviously do not load correctly on certain browsers and i have a few questions about what I can do and I don't have much experience with any codes like php or javascript. these questions are kind of a mess as well - I've been searching all over not really sure of what I should be looking for.

How would I go about creating a popup based on which browser is being used, if possible?

I understand that I can use conditional comments for IE but IE is not the only unsupported browser. Is there a way to activate certain elements, or div's depending on the browser?

How would I go about creating a version of the site that would be shown instead of the unsupported version?

Is there a better way to do this?

These questions may not be the right ones - if not and you know an answer to the question I'm looking for, please, go for it! Thanks!

解决方案

There are a few tools I would recommend:

Modernizr

Feature detection, allowing you to target features in CSS and JS. It doesn't add features, just lets you test for them.

Includes HTML5shiv functionality Also does a lot more – if you don't use the other features, then don't use it, it does slow down page loads, but is worth it if you need it!

HTML5shiv

Very small, allows you to use html5 elements in IE, nothing else.

CSS3PIE

Lets you use border-radius, gradients and box shadow in older versions of IE. Also can allow PNGs in IE 6. Adds a noticeable delay to page load.

ie7.js (and ie9.js)

Gives you many CSS3 selectors, min and max width, multiple classes and fixed positioning. Also can have a png fix if you like. Doesn't seem to slow things down much.

这篇关于使用不受支持的浏览器[HTML5 / CSS3]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆