HTML5新特性
簡潔的DOCTYPE:
HTML5 只有一個簡單的文檔類型:<!DOCTYPE html>,表示瀏覽器會按照標準模式解析。
簡單易記的編碼類型
你現在可以在meta 標簽中使用”charset”:<meta charset=”utf-8″ />
腳本和鏈接無需type
<link rel="stylesheet" href="path/to/stylesheet.css" /> <script src="path/to/script.js"></script>
更加語義化的新增標簽
比如說:<article>、<section>、<aside>、<hgroup>、 <header>,<footer>、<nav>、<time>、<mark>、<figure> 和<figcaption>等
<video width="640" height="320" preload="auto" poster="0.jpg" controls> <source src="movie.ogg" type="video/ogg" /> <source src="movie.mp4" type="video/mp4" /> Your browser does not support the video tag. </video>
表單增強
新的input類型:
color, email, date, month, week, time, datetime, datetime-local, number,range,search, tel, 和url
新屬性:
required, autofocus, pattern, list, autocomplete 和placeholder
新元素:<keygen>, <datalist>, <output>, <meter> 和<progress>
canvas標簽繪制2D圖形。
var canvas = document.getElementById('canvas'); var context = canvas.getContext('2d'); context.beginPath(); context.moveTo(100,100); context.lineTo(300,300); context.lineTo(100,500); context.lineWidth = 5; context.strokeStyle = "red"; context.stroke();
相信看了這些案例你已經掌握了方法,更多精彩請關注Gxl網其它相關文章!
相關閱讀:
有關HTML5頁面在iPhoneX適配問題
html
表格太寬溢出父容器的解決方法
如何用html的title屬性實現鼠標懸停顯示文字
HTML的cellpadding屬性與cellspacing屬性應該如何使用
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com