HTML5新增

一、HTML5结构标签

  • <header> :标记定义一个页面或一个区域的头部
  • <nav> 标记定义导航链接
  • <section> 标记定义一个区域
  • <aside> 标记定义页面内容部分的侧边栏
  • <article> 标记定义一篇文章
  • <footer> 标记定义一个页面或一个区域的底部

二、HTML5中Input新增的type

  • email
  • url
  • number
  • range
  • Date picker:
    Date —— 选取日、月、年
    Month —— 选取月、年
    Week —— 选取周和年
    Time —— 选取时间(小时和分钟)
    Datetime —— 选取时间、日、月、年(UTC 时间)
    Datetime-local —— 选取时间、日、月、年(本地时间)
  • search
  • color
  • tel

三、HTML5表单属性

  • autocomplete:自动完成,适用于 <form> 标签,以及以下类型的 <input> 标签:
    text, search, url, telephone, email, password, datepickers, range, color。
    用法:<form autocomplete="on“></form>或者单独在input中用off
  • autofocus:自动地获得焦点,适用于所有 <input> 标签的类型
    用法:<input autofocus="autofocus" />
  • multiple:可选择多个值,适用于<input>中type为email和file
    用法:<input type="file" multiple="multiple" />
  • placeholder:适用于<input>中type为:text, search, url, telephone, email, password
  • required:规定不能为空,适用于以下类型的 <input> 标签:
    text, search, url, telephone, email, password, date pickers, number, checkbox, radio, file
    用法:<input type="text" required="required" />
posted @ 2020-03-01 17:37  Allie71  阅读(121)  评论(0编辑  收藏  举报