标签:
</li>
或 </body>
)。type
属性,因为 text/css
和 text/javascript
分别是它们的默认值。1 <!DOCTYPE html> 2 <html lang="zh-CN"> 3 <head> 4 <title>Page title</title> 5 </head> 6 <body> 7 <img src="images/company-logo.png" alt="Company"> 8 <h1 class="hello-world">Hello, world!</h1> 9 </body> 10 </html>
HTML 属性应当按照以下给出的顺序依次排列,确保代码的易读性。
class
id
, name
data-*
src
, for
, type
, href
title
, alt
aria-*
, role
class 用于标识高度可复用组件,因此应该排在首位。id 用于标识具体组件,应当谨慎使用(例如,页面内的书签),因此排在第二位。
1 <a class="..." id="..." data-modal="toggle" href="#"> 2 Example link 3 </a> 4 5 <input class="form-control" type="text"> 6 7 <img src="..." alt="...">
1 <input type="text" disabled> 2 3 <input type="checkbox" value="1" checked> 4 5 <select> 6 <option value="1" selected>1</option> 7 </select>
标签:
原文地址:http://www.cnblogs.com/daixiaotian/p/5976707.html