HTML5的CSS重置 [英] CSS reset for HTML5

查看:153
本文介绍了HTML5的CSS重置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最佳做法?



这与HTML4或XHTML1有什么不同?



继续: http://html5doctor.com/html-5-reset-stylesheet/

解决方案



我想知道其他资源/讨论是否存在。 div>

对那篇文章的评论是疯狂的。你肯定不会有更彻底的讨论。
我认为你应该删除不必要的规则和已弃用的标签从任何重置你一直使用,并保持truckin。 Paul Irish(jQuery核心贡献者,Modernizr和现在的Googler的共同创建者)在您链接的文章中有一个注释,其中包含您可能需要的所有HTML5特定的CSS调整:

  article,aside,dialog,figure,footer,header,hgroup,nav,section {display:block; zoom:1; } 

Google在HTML5Rocks.com上的base.css中使用较简单的版本:

  section,article,header,footer {display:block; } 

您仍然需要使用Remy Sharp的简单基础HTML5 Shiv或Modernizr JavaScript循环,以在IE中启用新的HTML5元素样式。 HTML5 Shiv只是创建了允许样式化的元素,Modernizr是一个更全功能的HTML5和CSS3检测/样式解决方案。还有另一个HTML5博客值得一看的好主意,如何使用HTML5在您的客户端工作现在从2010年3月,由雷米和理查德8个月后重置文章。他们提到使用Modernizr来检测Web窗体2.0和其他HTML5类型的支持。



此外,Dion(来自Ajaxian和现在的Palm)发布了关于css3pie,元素像边框半径,box-shadow和渐变在IE。



(我在这里有更多链接,但是除了一个b / c我的代码之外,所有的链接都是< 10,如果有你不能找到的东西回复,我会发布。)


Best practices?

How does this differ from HTML4 or XHTML1?

There's a lot of discussion going on over here: http://html5doctor.com/html-5-reset-stylesheet/

I'm wondering what other resources/discussion exists.

解决方案

The comments on that post are crazy. You're certainly not going to find a more thorough discussion. I think you should delete unnecessary rules and deprecated tags from whatever reset you've been using and keep truckin. Paul Irish (jQuery core contributor, co-creator of Modernizr and now Googler) has a comment in the article you link to that has all the HTML5 specific CSS leveling you're likely to need:

article, aside, dialog, figure, footer, header, hgroup, nav, section { display:block; zoom:1; }

Google's using a simpler version in their base.css on HTML5Rocks.com:

section, article, header, footer {  display: block; }

You'll still need to use Remy Sharp's simple, bare-bones HTML5 Shiv or Modernizr to run a JavaScript loop to enable styling of new HTML5 elements in IE. HTML5 Shiv just creates the elements to allow styling, Modernizr is a much more full-featured HTML5 and CSS3 detection/styling solution. There's another great post on HTML5 Doctor worth a look, How to use HTML5 in your client work right now from March 2010, co-written by Remy and Richard 8 months after the reset article. They mention using Modernizr "to detect Web Forms 2.0 and other HTML5-type support."

Also, Dion (from Ajaxian and now Palm) tweeted about css3pie that will render visual elements like border-radius, box-shadow, and gradients in IE. Can't vouch for it myself.

(I had more links in here but had to remove all but one b/c my rep. is < 10, if there's something you can't find. reply and I'll post it.)

这篇关于HTML5的CSS重置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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