日期:2013-12-26 浏览次数:20804 次
在这篇文章中,我将给大家分享html5构建页面的小错误和不好的实践方法,让我们在当前的任务中避免这些错误。
我们经常看到的一个错误,就是武断的将<div>标签用<section>标签来替代,特别是将作为包围容器的<div>用<section>来替换。在XHTML或者HTML4中,我们将会看到类似下面的代码:
| 
             1
             2
             3
             4
             5
             6
             7
             8
             9
             10
             11
             12
             13
             14
             15
             16
              | 
            
            <!-- HTML 4-style code --> 
            <div id="wrapper"> 
              <div id="header"> 
                <h1>My super duper page</h1> 
                <!-- Header content --> 
              </div> 
              <div id="main"> 
                <!-- Page content --> 
              </div> 
              <div id="secondary"> 
                <!-- Secondary content --> 
              </div> 
              <div id="footer"> 
                <!-- Footer content --> 
              </div> 
            </div>
            
             |