笔记 - HTML5 for Web Designers - 100830

cover-html5-for-web-designeBrowsers won’t apply any default styling to the new elements.So, at the very least, you will want to declare that the new structural elements should force a line break:

section, article, header, footer, nav, aside, hgroup {
	display: block;
}

Internet Explorer has special needs.It resolutely refuses to recognize the new elements unless an exemplar of each element is first created with JavaScript, like this:

document.createElement('section');

Load this script within a conditional comment so that it’s only served up to the needy Internet Explorer:

<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

Geoffrey Sneddon has written a handy online tool that will generate an outline as specified in HTML5: http://gsnedders.html5.org/outliner/

Henri Sivonen has created a full-featured HTML5 validator at http://validator.nu/.


收藏与分享

添加评论


Security code
换一张图