HTML5基础知识
HTML5简介
HTML5是目前正在讨论的新一代HTML标准,它代表了现在Web领域的最新发展方向。在HTMNL5标准中,加入了新的多样的内容描述标签、直接支持表单类型和验证、音频视频标签、网页元素的拖拽、离线存储、Socket以及多线程等功能。
支持HTML5的浏览器
Opera +
Safari +
FireFox +
Explorer +
Chrome
HTML5技术概览
HTML5新增和移除的元素
HTML5基本布局
HTML5对表单的支持
HTML5 DOM变化
HTML5的Javascript API
Canvas
Video&Audio
Drag&Drop
Geolocation
Application Cache
Web storage
Web SQL Database
Messaging
Web Worker
Web Socket
HTML5新增的元素
多媒体及交互式元素
video, audio...
details, menu, command...
结构元素
header, footer, section, article, nav...
块级语义及行内元素
aside, figure, dialog...
time, meter, mark, progress...
表单控件
email, url, datetime, number, range, color...
HTML5新增的属性
contenteditable, contextmenu, data-*, hidden, item, itemprop, subject, role, aria-*, spellcheck, draggable, irrelevant, template, placeholder, autofocus, required, async, manifest...
HTML5新增的事件
onabort, onbeforeunload, oncontextmenu, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onerror, onmessage, onmousewheel, onresize, onscroll, onunload...
HTML5移除的元素
移除的元素
font, center, strike, big, s, u, acronym, applet, dir, frame, frameset...
移除的属性
如link和a元素的rev属性, link元素的target属性, td的scope属性,script元素的language属性, body元素的alink,link,text和vlink属性...
HTML5基本布局
HTML4
HTML5
<!DOCTYPE html>
<htm lang = "en">
<head>
<meta charset = "utf-8">
<title>HTML5 Demo</title>
<body>
<header>
<h1></h1><h2></h2>
</header>
<nav>
<ul><li></li><li></li></ul>
</nav>
<section>
<article></article>
<article></article>
</section>
<aside></aside>
<footer></footer>
</body>
</html>
HTML5对表单的支持
新的控件类型
url/email/date/tel/search/datetime/date/month/week/datetime-local/number/range/color
<select data="http://domain/getoptions"></select>
文件上传控件
<input type="file" accept = "image/png" />
内建表单验证
<input type="email" required />
<input type="number" min=10 max=100 />
XML Submission
application/x-
<form action='/register' enctype="application/x-" method="post">
<p>
<label for='name'>ID(请使用Email注册)</label>
<input name
基础知识 来自淘豆网m.daumloan.com转载请标明出处.