是时候切换到 HTML5 和 CSS3 了吗?
可能的重复:
我应该使用 HTML5 和 CSS3 吗?
您如何决定是否使用需要使用html5和css3吗?以及选择这种方法的优点和缺点是什么。
我能想到的优点和缺点:
优点:
- 更清晰的代码
- 支持@font-face
- 阴影和圆角
- 动画
缺点:
- 并非所有浏览器都支持
你能帮我决定吗?如果你处于我的情况,你会如何判断?
谢谢!
Possible Duplicate:
Should i be using HTML5 and CSS3?
How do you decide if you need to use html5 and css3? and what will be the pros and cons in choosing that approach.
Pros and cons I can think of:
Pros:
- cleaner codes
- support for @font-face
- shadows and rounded corner
- animations
Cons:
- not all browsers supports
Can you help me decide? How do you decide if you're in my situation?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
确实,在很长一段时间内还不是切换到“HTML5 和 CSS3”的时候。
现在是时候仔细查看 HTML 5 和 CSS 3 添加的功能,并根据具体情况做出决定:
......哪些 <现在值得使用的特定功能。
It won't be time to switch to "HTML5 and CSS3" for a very long time indeed.
It is time to look carefully at the features added by HTML 5 and CSS 3 and decide, on a case by case basis based on:
… which specific features it is worth using today.
一个设计良好的网站应该始终优雅地降级,HTML 和 CSS 都支持这一点。目标不应该是让您的网站在旧版浏览器中看起来很棒,而只是让您的网站在旧版浏览器中可用。一个设计良好的网站应该可以在关闭 CSS 的情况下使用。
A well designed site should always degrade gracefully and both HTML and CSS support this. The goal should not be to make your look fantastic in older browsers - only to make your site USEABLE in older browsers. A well designed site should be useable with CSS turned off.
我认为只有在目标浏览器兼容之后才能明确“是”。但是,如果我的目标浏览器支持 HTML5 的特定功能,并且我的开发仅限于这些支持的功能,则可以使用 HTML5。
I think a clear YES can come only after the target browsers are compatible. However, if my target browser supports the specific features of HTML5 and my development is limited to these supported features, HTML5 can be used.
有些人仍然使用古埃及人曾经使用过的浏览器,例如 IE6,他们将无法查看您的页面(特别是新样式/标签)。
如果您有一个几乎任何人都可以访问的公共网站,我建议您至少等待几年才能进行大规模转换。
另一方面,如果您有一个可控的用户组,就像我正在开发的 Intranet 站点一样,您可以轻松地强制使用支持此功能的更现代的浏览器,例如 Google Chrome、Apple Safari、Mozilla Firefox、 Internet Explorer 9(刚刚发布)。
Some people still use browsers once used by the ancient egyptians, like IE6, and they will not be able to view your pages (and specifically new styles/tags).
If you have a public website, accessable to virtually anybody, I suggest waiting for at least a couple of years before the big convert.
If, on the other hand, you have a controllable group of users, like the intranet site I'm working on, you can easily enforce the use of more modern browsers that support this, like Google Chrome, Apple Safari, Mozilla Firefox, of Internet Explorer 9 (just released).
我相信这完全取决于你的目标是谁。如果你的目标是开发者,例如 Stack Overflow,那么我认为你可以使用新技术。如果您确实需要显示升级消息,那么我相信开发人员会理解。
您不应该将其用于一般网站,例如拥有广泛受众的商店。这是因为他们中的很多人都会使用 IE 6 - 8。事实上,XP 上没有人(我的整个办公室 + 几乎我认识的其他人)可以升级到支持某些功能的 IE9,这一事实也令人沮丧。
所以我认为不会有一个明确的日子让每个人都可以使用它。这只是查看浏览器的市场份额和目标受众,并决定是否值得为 99% 的人提供更好的体验而忽略其他 1% 的情况。尽管我确信这些数字完全错误,但情况可能要糟糕得多。
总之,这取决于您的受众以及您是否愿意不支持不同数量的用户。
I believe it is entirely down to who you are targeting. If you are targeting developers, Stack Overflow for example, then I think you can use the new technologies. If you really need to display a message to upgrade then I am sure developers would understand.
You should not use it for general sites for something such as a shop which has a very wide audience. This is because a lot of them would be using IE 6 - 8. The fact that no one on XP (my whole office + pretty much everyone else I know) can upgrade to IE9 which supports some features is frustrating too.
So I don't think there will be a definitive day where everyone can use it. It is just a case of looking at the market share of browsers and your target audience and deciding if it is worth giving 99% of people a better experience and ignoring the other 1%. Although I am sure those figures are completely off, it is probably a lot worse.
In conclusion, it depends on your audience and if you are willing to not support a varying number of users.