如何为不支持 HTML 5 的浏览器提供支持?
我想使用 HTML 5 创建一个网页,它将使用 HTML5 的所有有吸引力的功能,即音频、视频、自动对焦、占位符、必需、电子邮件、网址、数字等,并且该网页还应该支持不支持 HTML5 的浏览器像 IE 或其他流行浏览器的某些版本,如 Chrome、Firefox、opera 等。
我如何开始处理这个问题,因为你可能会猜到这只是为了实验目的,我应该尽快......所以请建议我任何帮助,网站或博客或教程或示例..我看过hhtml5Doctor.com和diveintohtml5.ep.io ...这些网站有很大帮助...
I want to create a webPage using HTML 5 which will use all the attractive features of HTML5 i.e. audio, video, autofocus, placeholder, required, email, url, number etc. and the webPage should also have support for the browsers which dont support HTML5 like IE or some versions of other popular browsers such as Chrome, Firefox, opera etc.
How do I start working on that, as You might guess that this is just for the experimental purpose and I am supposed to it asap... so please suggest me any help, site or blog or tutorial or example.. I have seen hhtml5Doctor.com and diveintohtml5.ep.io ... the sites are of great help...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
使用渐进增强。 divintohtml5 已经告诉您如何操作: http://diveintohtml5.ep.io/detect.html
Use progressive enhancement. The diveintohtml5 already tells you how: http://diveintohtml5.ep.io/detect.html
html5boilerplate 是一个好的开始,它包括 modernizr/html5shiv 用于对新元素的准系统支持。
其他事情可能需要 javascript/flash 后备。
html5boilerplate is a good start, it includes modernizr/html5shiv for barebones support of the new elements.
Other things may need javascript/flash fallbacks.
您可以利用浏览器会忽略它们不理解的标签这一事实。例如,您可以有一个
audio
标签,并在其中放置一个用于 Flash 音频播放器的object
标签。 HTML5 浏览器将理解audio
标签并执行正确的操作,并忽略子内容。较旧的浏览器会看到audio
标记并将其丢弃,因为它不理解它,但会渲染该标记的子内容(flash 播放器)。You can make use of the fact that browsers will ignore tag that they don't understand. So, for example, you can have an
audio
tag and inside that put anobject
tag for a flash audio player. The HTML5 browser will understand theaudio
tag and do the right thing, and ignore the child content. An older browser will see theaudio
tag and throw it away beacuse it doesn't understand it, but will render the child contents of the tag instead (the flash player).swfobject 和 Modernizer 是非常好的工具...你必须尝试一下...我个人推荐 swfObject 因为它有很好的支持。
swfobject and Modernizer are really nice tools... u must give them a try... I would personally recommend swfObject due to very good support.