设置默认HTML 5页面的最佳方式?

时间:2011-05-09 10:42:40

标签: css html5

为HTML 5网站设置样式的最佳方式是什么(在IE6中也能运行)?

<header>
    [ Header ]
</header>

<section>

    <article>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent varius ultricies nibh faucibus tempor. Aliquam erat volutpat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Praesent hendrerit nunc vitae nisl accumsan dictum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Integer convallis lobortis turpis posuere semper. Proin ligula mi, hendrerit sit amet feugiat eu, dapibus sed ante. Donec lacinia aliquam felis at gravida. Praesent varius lectus enim. Nulla vehicula, odio id feugiat ornare, nibh urna elementum arcu, ut suscipit odio velit vel augue. Maecenas enim dolor, tincidunt a luctus ornare, viverra ut lorem. Suspendisse imperdiet est id mi pulvinar quis interdum felis vehicula.
    </article>

    <aside>
        [ Aside ]
    </aside>

</section>

<footer>
    [ Footer ]
</footer>

CSS

header {
    display:block;
    clear:both;
    background-color:red;
    height:43px;
}

section article {
    display:block;
    float:left;
    width:800px;
    background-color:green;
}

section aside { 
    display:block;
    width:180px;
    background-color:lime;
}

footer {
    display:block;
    clear:both;
    background-color:blue;
    height:43px;
}

我真正的问题,我现在必须在标签后添加吗?

2 个答案:

答案 0 :(得分:3)

您需要知道的一切都在http://html5boilerplate.com/

答案 1 :(得分:1)

请记得添加

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

确保IE可以设置这些元素的样式。