简体   繁体   English

浏览器对CSS3和CSS2的支持? 更重要的是,针对CSS2或CSS3进行设计?

[英]Browser support for CSS3 vs CSS2? More importantly, design against CSS2 or CSS3?

Does anyone have any updated stats regarding browser support for CSS3 vs CSS2? 有人对浏览器对CSS3和CSS2的支持有更新的统计信息吗? There are old SO posts from 2008, but we're curious how broadly supported CSS3 is now. 从2008年开始有旧的SO帖子,但是我们很好奇CSS3现在得到了广泛的支持。

More importantly, should we design with CSS2 in mind or CSS3? 更重要的是,我们在设计时应该考虑CSS2还是CSS3?

Thanks! 谢谢!

More importantly, should we design with CSS2 in mind or CSS3? 更重要的是,我们在设计时应该考虑CSS2还是CSS3?

it's not an either or scenario, probably never will be, you can't have one without the other - CSS2 should be your base, CSS3 (modules) should be your enhancements, rounded corners, multiple backgrounds etc.. you can enhance the non CSS3 browsers with JS libraries to help but it should always degrade to a perfectly usable CSS2 site no matter the browser or the scripted enhancements 这不是一个或两个场景,可能永远不会,没有另一个就不可能有一个-CSS2应该是您的基础,CSS3(模块)应该是您的增强,圆角,多个背景等。您可以增强非带有JS库的CSS3浏览器可以提供帮助,但无论浏览器或脚本增强功能如何,它都应始终降级为完美可用的CSS2网站

  • so CSS2 with a bit of CSS3 fun ;) 所以CSS2有点CSS3的乐趣;)

It really depends on the features in CSS3 that you want. 它实际上取决于所需的CSS3功能。

Eg if you want to use rounded corners on elements, feel free to sprinkle them in (knowing that IE8/IE7/IE6 users will get a downgraded experience (Square corners)) 例如,如果您想在元素上使用圆角,请随意添加(知道IE8 / IE7 / IE6用户将获得降级的体验(方角))

.roundedCorners{
  -webkit-border-radius:5px;/* Safari, Chrome, Blackberry, etc. */
     -moz-border-radius:5px;/* Firefox, Camino, Flock, etc. */
          border-radius:5px;/* IE9, other browsers with ready implementations */
}

You'll just need to be aware that some users won't see your fancy stuff. 您只需要注意某些用户不会看到您喜欢的东西。 Be sure to test in other browsers to ensure that the site/content is still usable. 确保在其他浏览器中进行测试,以确保该站点/内容仍然可用。

Exist some js library that will help you to fill the lack of support of certain browsers. 存在一些js库,它将帮助您填补某些浏览器缺乏的支持。 For example: http://selectivizr.com/ helps a lot with IE 例如: http : //selectivizr.com/对IE很有帮助

And to check if browser support any specific CSS I use http://caniuse.com/ website. 并检查浏览器是否支持任何特定的CSS,我使用http://caniuse.com/网站。 And naturally in base of my audience browser statistic and trned I decide what to use or not. 当然,根据我的受众群体浏览器的统计数据并确定,我决定使用或不使用什么。

The important thing is: if you want to try to go and play with CSS3, please do it . 重要的是: 如果您想尝试使用CSS3,请这样做 The only thing that you have to be aware it is that whatever you do, be sure that it is easy to degrade in the case that there is no support for it (for example Mobiles do not have the same standard of web browsers). 您唯一需要知道的是,无论您做什么,都必须确保在不支持它的情况下它很容易降级(例如,Mobiles不具有相同的Web浏览器标准)。

The most important point is: DO NOT EXPECT TO SEE THE SAME WEB DESIGN IDENTICAL IN ALL THE BROWSERS . 最重要的一点是: 不要期望在所有浏览器中都看到相同的Web设计 Accept that every browser has differences in rendering and do not fall in the misconcept of the print of making every copy identical. 接受每个浏览器在渲染上都有差异,并且不要陷入使每个副本都相同的印刷错误观念。 It is not possible with the web. 网络是不可能的。 Make them similar, but live with acceptance of the difference, and if you can do some more cool stuff for Chrome or FF, please do it (it is all up to you if you want to make the extra effort). 使它们相似,但要接受差异,如果您可以为Chrome或FF做一些更酷的事情,请这样做(如果您要付出更多的努力,则取决于您自己)。

People of IE will not miss out the experience , they will not know the difference. IE的人们不会错过体验 ,他们不会知道区别。 When they will update or change the browser they will discover a new aspect that they didn't before, thinking that was more an update than their own limitation of browser. 当他们更新或更改浏览器时,他们会发现以前从未有过的新方面,认为这不仅仅是对其浏览器的限制,而是更新。

This graph shows you the percentage on each browser so far this year worldwide: 该图向您显示了今年迄今为止全球每种浏览器所占的百分比:

http://gs.statcounter.com/#browser_version-ww-monthly-201101-201103-bar http://gs.statcounter.com/#browser_version-ww-monthly-201101-201103-bar

Assuming that all browsers except IE (At the time of writing, IE9 had only just been released) support CSS3, then around 55% of users can use CSS3 and many HTML5 features. 假设除IE(在撰写本文时,IE9才刚刚发布)之外的所有浏览器都支持CSS3,那么大约55%的用户可以使用CSS3和许多HTML5功能。

In my opinion, the benefits outweigh the costs and the time is right to start using CSS3 and HTML5. 在我看来,收益超过成本,并且是时候开始使用CSS3和HTML5了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM