這篇文章主要介紹了一個極簡的Html5模版,代碼功能的說明基本上都融入於注釋之中,需要的朋友可以參考下
分享一個Html5頁面開發的基礎性模板,包含了兩個版本:開發版本和注釋版本。可以被用於基礎的服務器端編程框架框架之中^_^
開發版本
XML/Html Code復制內容到剪貼板
- <!DOCTYPE Html>
- <Html>
- <head>
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta charset="utf-8">
- <title></title>
- <meta name="description" content="">
- <meta name="author" content="">
- <meta name="vIEwport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="">
- <!--[if lt IE 9]>
- <script src="//cdn.JSdelivr.Net/<span style="width: auto; height: auto; float: none;" id="11_nwp"><a style="text-decoration: none;" mpid="11" target="_blank" href="http://cpro.baidu.com/cpro/ui/uiJS.PHP?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=ab4a7d1f97e0f21c&k=html5&k0=Html5&kdi0=0&luki=6&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=1cf2e0971f7d4aab&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F4756%2EHtml&urlid=0" id="11_nwl"><span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">Html5</span></a></span>shiv/3.7.2/Html5shiv.min.JS"></script>
- <script src="//cdnJS.cloudflare.com/AJax/libs/respond.js/1.4.2/respond.min.JS"></script>
- <![endif]-->
- <link rel="shortcut icon" href="">
- </head>
- <body>
-
- <!-- 這裡添加頁面主要內容 -->
-
- <!-- SCRIPTS:個人建議在天朝不要使用Google的CDN了,是不是你就發現你的網站功能失效了 -->
- <!-- Example: <script src="//AJax.googleapis.com/AJax/libs/jquery/1.11.1/jquery.min.JS"></script> -->
- </body>
- </Html>
注釋版本
XML/Html Code復制內容到剪貼板
- <!DOCTYPE <span style="width: auto; height: auto; float: none;" id="0_nwp"><a style="text-decoration: none;" mpid="0" target="_blank" href="http://cpro.baidu.com/cpro/ui/uiJS.PHP?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=ab4a7d1f97e0f21c&k=html&k0=Html&kdi0=0&luki=2&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=1cf2e0971f7d4aab&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F4756%2EHtml&urlid=0" id="0_nwl"><span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">Html</span></a></span>>
- <!--
- 設置lang值來保證<Html><span style="width: auto; height: auto; float: none;" id="1_nwp"><a style="text-decoration: none;" mpid="1" target="_blank" href="http://cpro.baidu.com/cpro/ui/uiJS.PHP?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=ab4a7d1f97e0f21c&k=%B1%EA%C7%A9&k0=%B1%EA%C7%A9&kdi0=0&luki=3&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=1cf2e0971f7d4aab&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F4756%2EHtml&urlid=0" id="1_nwl"><span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">標簽</span></a></span>的互操作性及其可訪問性
- 更多Html標簽全局性屬性
- 請閱讀這裡: http://www.w3.org/TR/html-markup/global-attributes.Html -->
- <Html>
-
- <<span style="width: auto; height: auto; float: none;" id="2_nwp"><a style="text-decoration: none;" mpid="2" target="_blank" href="http://cpro.baidu.com/cpro/ui/uiJS.PHP?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=ab4a7d1f97e0f21c&k=head&k0=head&kdi0=0&luki=4&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=1cf2e0971f7d4aab&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F4756%2EHtml&urlid=0" id="2_nwl"><span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">head</span></a></span>>
-
- <!--
- 告訴IE使用目前最新的布局引擎:
- 更多信息閱讀這裡: https://www.modern.IE/en-us/performance/how-to-use-x-ua-compatible -->
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
-
- <!--
- 針對web性能定義字符集,首選通過HTTP header來設置
- 確保HTTP header和Meta標簽設置一致
- 更多信息閱讀這裡: https://developers.google.com/speed/docs/best-practices/rendering#SpecifyCharsetEarly -->
- <meta charset="utf-8">
-
- <!-- 指定頁面標題 -->
- <title></title>
-
- <!-- 指定web頁面描述 -->
- <meta name="description" content="">
-
- <!-- 指定web頁面作者 -->
- <meta name="author" content="">
-
- <!-- 提示移動浏覽器使用設備<span style="width: auto; height: auto; float: none;" id="3_nwp"><a style="text-decoration: none;" mpid="3" target="_blank" href="http://cpro.baidu.com/cpro/ui/uiJS.PHP?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=ab4a7d1f97e0f21c&k=%BF%ED%B6%C8&k0=%BF%ED%B6%C8&kdi0=0&luki=1&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=1cf2e0971f7d4aab&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F4756%2EHtml&urlid=0" id="3_nwl"><span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">寬度</span></a></span>和縮放比 -->
- <meta name="vIEwport" content="width=device-width, initial-scale=1">
-
- <!-- 在頁面加載前來加載CSS
- 保證相關樣式的及時加載
- 指定對應的URI屬性 -->
- <link rel="stylesheet" href="">
-
- <!--
- 加載<span style="width: auto; height: auto; float: none;" id="4_nwp"><a style="text-decoration: none;" mpid="4" target="_blank" href="http://cpro.baidu.com/cpro/ui/uiJS.PHP?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=ab4a7d1f97e0f21c&k=Html&k0=html&kdi0=0&luki=2&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=1cf2e0971f7d4aab&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F4756%2EHtml&urlid=0" id="4_nwl"><span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">Html</span></a></span>shiv和respond.JS來兼容老版本的IE浏覽器
- 方便使用Html5中的新元素和media querIEs -->
- <!--[if lt IE 9]>
- <script <span style="width: auto; height: auto; float: none;" id="5_nwp"><a style="text-decoration: none;" mpid="5" target="_blank" href="http://cpro.baidu.com/cpro/ui/uiJS.PHP?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=ab4a7d1f97e0f21c&k=src&k0=src&kdi0=0&luki=5&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=1cf2e0971f7d4aab&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F4756%2EHtml&urlid=0" id="5_nwl"><span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">src</span></a></span>="//cdn.JSdelivr.Net/<span style="width: auto; height: auto; float: none;" id="6_nwp"><a style="text-decoration: none;" mpid="6" target="_blank" href="http://cpro.baidu.com/cpro/ui/uiJS.PHP?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=ab4a7d1f97e0f21c&k=Html5&k0=Html5&kdi0=0&luki=6&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=1cf2e0971f7d4aab&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F4756%2EHtml&urlid=0" id="6_nwl"><span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">Html5</span></a></span>shiv/3.7.2/Html5shiv.min.JS"></script>
- <script src="//cdnJS.cloudflare.com/<span style="width: auto; height: auto; float: none;" id="7_nwp"><a style="text-decoration: none;" mpid="7" target="_blank" href="http://cpro.baidu.com/cpro/ui/uiJS.PHP?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=ab4a7d1f97e0f21c&k=ajax&k0=AJax&kdi0=0&luki=8&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=1cf2e0971f7d4aab&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F4756%2EHtml&urlid=0" id="7_nwl"><span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">AJax</span></a></span>/libs/respond.js/1.4.2/respond.min.JS"></script>
- <![endif]-->
-
- <!-- 指定favicon的URI -->
- <link rel="shortcut icon" href="">
-
- <!-- 下面注釋掉的是iOS/android書簽圖標-->
- <!--
- <meta name="mobile-web-app-capable" content="yes">
- <link rel="icon" sizes="196x196" href="">
- <link rel="apple-touch-icon" sizes="152x152" href="">
- -->
-
- <!--
- 如果可能使用async屬性來非阻斷的加載腳本
- 例子: <script <span style="width: auto; height: auto; float: none;" id="8_nwp"><a style="text-decoration: none;" mpid="8" target="_blank" href="http://cpro.baidu.com/cpro/ui/uiJS.PHP?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=ab4a7d1f97e0f21c&k=src&k0=src&kdi0=0&luki=5&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=1cf2e0971f7d4aab&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F4756%2EHtml&urlid=0" id="8_nwl"><span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">src</span></a></span>="" async></script> -->
- </<span style="width: auto; height: auto; float: none;" id="9_nwp"><a style="text-decoration: none;" mpid="9" target="_blank" href="http://cpro.baidu.com/cpro/ui/uiJS.PHP?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=ab4a7d1f97e0f21c&k=head&k0=head&kdi0=0&luki=4&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=1cf2e0971f7d4aab&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F4756%2EHtml&urlid=0" id="9_nwl"><span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">head</span></a></span>>
- <body>
-
- <!-- 這裡添加頁面主要內容 -->
-
- <!-- 如果可能使用async屬性來非阻斷的加載腳本 -->
- <!-- SCRIPTS -->
- <!-- 例子: <script src="http://<span style="width: auto; height: auto; float: none;" id="10_nwp"><a style="text-decoration: none;" mpid="10" target="_blank" href="http://cpro.baidu.com/cpro/ui/uiJS.PHP?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=0&is_app=0&jk=ab4a7d1f97e0f21c&k=AJax&k0=AJax&kdi0=0&luki=8&n=10&p=baidu&q=06011078_cpr&rb=0&rs=1&seller_id=1&sid=1cf2e0971f7d4aab&ssp2=1&stid=0&t=tpclicked3_hc&tu=u1922429&u=http%3A%2F%2Fwww%2Eadmin10000%2Ecom%2Fdocument%2F4756%2EHtml&urlid=0" id="10_nwl"><span style="color:#0000ff;font-size:14px;width:auto;height:auto;float:none;">ajax</span></a></span>.googleapis.com/AJax/libs/jquery/1.11.1/jquery.min.JS"></script> -->
- </body>
- </Html>