首页前端开发HTMLHTML5新知识

HTML5新知识

时间2024-01-23 00:03:02发布访客分类HTML浏览539
导读:收集整理的这篇文章主要介绍了HTML5新知识,觉得挺不错的,现在分享给大家,也给大家做个参考。一、h5新增的主要语义化标签如下:1、header 页面头部、页眉2、nav 页面导航3、atricle 一篇文章4、section 文章中的章节...
收集整理的这篇文章主要介绍了HTML5新知识,觉得挺不错的,现在分享给大家,也给大家做个参考。

一、h5新增的主要语义化标签如下:

1、header 页面头部、页眉

2、nav 页面导航

3、atricle 一篇文章

4、section 文章中的章节

5、aside 侧边栏

6、footer 页面底部、页脚

PC端兼容h5新标签的方法,在页面中引入一下js文件

script tyPE="text/javascript" src="//cdn.bootcss.COM/htML5shiv/r29/html5.js?1.1.11"> /script>

二、HTML5新增表单控件

1、新增类型:网址 邮箱 日期 时间 星期 数量 范围 电话 颜色 搜索

  a、label> 网址:/label> input type="url" name=" " required>
  b、label> 邮箱:/label> input type="email" name=" " required>
  c、label> 日期:/label> input type="date" name=" ">
  d、label> 时间:/label> input type="time" name=" ">
  e、label> 星期:/label> input type="week" name=" ">
  f、label> 数量:/label> input type="number" name=" ">
  g、label> 范围:/label> input type="range" name=" " >
  h、label> 电话:/label> input type="tel" name=" " >
  i、label> 颜色:/label> input type="color" name=" ">
  j、label> 搜索:/label> input type="seArch" name=" ">

2、新增常用表单控件属性

input type="text" placeholder="请输入用户名" autofocus autocomplete="off">

  a、placeholder 设置文本框默认提示文字

  b、autofocus 自动获得焦点

  c、autocomplete 设置是否有联想关键词下拉,一般设置为"off",将其关掉 如:autocomplete="off"

三、HTML5音频audio和视频video

html5增加了audio和video标签,提供了在页面上插入音频和视频的标准方法

1、audio标签 支持格式:ogg、wav、mP3

对应的属性:

  a、autoplay 自动播放

  b、controls 显示播放器

  c、loop 循环播放器

  d、PReload 预加载

  e、multed 静音

如:audio src="source/audio.mp3" autoplay controls loop preload> /audio>

audio autoplay controls loop preload>

  source src="source/audio.wav" type="">

  source src="source/audio.mp3" type="">

/audio>

source标签的作用是提供多个媒体文件地址,如果一个地址的文件不兼容,就使用下一个地址。

2、video标签 支持格式:ogg、mp4、webM

对应的属性:

  a、width

  b、height

  c、Poster

如:video src="source/audio.mp3" autoplay controls loop preload width="600" height="400"> /video>

3、可选择第三方播放器

  a、cyberplayer

  b、tencentPlayer

  c、youkuPlayer

以上就是HTML5新知识的详细内容,更多请关注其它相关文章!

声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!

h5

若转载请注明出处: HTML5新知识
本文地址: https://pptw.com/jishu/583540.html
IDEA如何安装vue开发插件安装图文教程 createjs 小游戏开发的实例过程

游客 回复需填写必要信息