html5较于xhtml的优点
来源:互联网 发布:电器设计软件 编辑:程序博客网 时间:2024/04/30 01:19
1、支持视频和音频文件的播放。就像支持图片文件一样。
音频文件
<audio controls="controls" autoplay="autoplay">
<source src="file.ogg" />
<source src="file.mp3" />
<a href="file.mp3">Download this file.</a>
</audio>
<source src="file.ogg" />
<source src="file.mp3" />
<a href="file.mp3">Download this file.</a>
</audio>
视频文件
<video controls preload>
<source src="cohagenPhoneCall.ogv" type="video/ogg"; codecs='vorbis, theora'" />
<source src="cohagenPhoneCall.mp4" type="video/mp4; 'codecs='avc1.42E01E, mp4a.40.2'" />
<div> your browser is old. <a href="cohagenPhoneCall.mp4">download this video instead.</a> </div>
</video>
<source src="cohagenPhoneCall.ogv" type="video/ogg"; codecs='vorbis, theora'" />
<source src="cohagenPhoneCall.mp4" type="video/mp4; 'codecs='avc1.42E01E, mp4a.40.2'" />
<div> your browser is old. <a href="cohagenPhoneCall.mp4">download this video instead.</a> </div>
</video>
2、必填项属性<input type="text" name="someInput" required="required">
加上required属性即为必填项,无须再通过JS写验证
3、直接使用正则表达式<input id="username" type="text" name="username" placeholder="4 <> 10" required="required" autofocus="autofocus" pattern="[A-Za-z]{4,10}">
可以直接在pattern属性中书写正则表达式,无须再通过JS去匹配
4、邮箱验证<input id="email" type="email" name="email">新增email类型,无需再通过JS去验证邮箱格式
5、占位符属性<input type="email" name="email" placeholder="doug@givethesepeopleair.com">
6、可以不用双引号<h6 id=someid class=myclass> start the reactor. </h6>设置ID和样式时可省略""这种写法了
7......
8......
9......
总言之,html5在xhtml的基础上新增了部分标记,扩展了一些原来标记的属性和类型。从而达到使开发更轻松省事,页面更美观,简洁
- html5较于xhtml的优点
- XHTML MP的优点
- 采用xhtml+css的优点
- xhtml通过较证的flash代码
- HTML5的优点
- 简述HTML5的优点
- HTML5的优点
- HTML5的优点
- html5和xhtml的关系
- html5的优点有哪些
- Hibernate4较于Hibernate3的改动
- 浅谈HTML/XHTML/HTML5之间的渐变
- HTML5基础19----XHTML的使用规范
- html html5 xhtml的区别和联系
- XHTML与HTML、HTML5的区别
- html5、xhtml与html4的区别
- FineReport较HTML5图表软件的优势
- 关于html5的一些历史和优点
- JAVA语言,谈谈其独特之处
- 改变sqlserver2000排序规则
- 请各位C++大牛说说项目怎么合理的管理文件
- Android FrameWork概述
- JVM垃圾回收机制总结(1) :一些概念
- html5较于xhtml的优点
- 如何更好的读别人写的代码
- 过滤敏感字的算法
- Windows程序调试系列文章——Windbg轻松上路
- CE6 CPU 使用率
- JVM垃圾回收机制总结(2) :基本算法概述
- webkit 常用操作代码调用流程
- Linux修改IP和DNS
- 如何找内存泄露