码迷,mamicode.com
首页 > Web开发 > 详细

推荐的HTML5书写格式

时间:2014-05-22 15:47:10      阅读:305      评论:0      收藏:0      [点我收藏+]

标签:style   blog   class   c   code   java   

1. 元素和属性全部小写

2. 属性值尽量使用引号包围

3. 成对标签都要闭合

4. 空元素无需结束

5. <html>标签有lang属性。en代表英语,zh代表中文,不区分大小写

6. 无需完整地书写所有属性名等于属性值的属性

7. 推荐在每个html文件中引入重置样式表normalize.css

8. 为HTML5语义元素添加跨浏览器支持http://html5shiv.googlecode.com/svn/trunk/html5.js

9. 给旧版IE添加CSS3修饰特性的支持http://css3pie.com/

bubuko.com,布布扣
 1  <!doctype html>
 2 <html lang="zh">
 3       <head>
 4           <meta charset="utf-8">
 5           <link rel="stylesheet" href="css/normalize.css">
 6           <!--[if lt IE 9]
 7               <scriptsrc="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
 8           <![endif]-->
 9       </head>
10       <body>
11          <span>姓名:</span><input type="text" required>
12      </body>
13  </html>
bubuko.com,布布扣

 

 

推荐的HTML5书写格式,布布扣,bubuko.com

推荐的HTML5书写格式

标签:style   blog   class   c   code   java   

原文地址:http://www.cnblogs.com/weiheli/p/3744098.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!