新增语义化标签:
头部标签 | <header> |
导航标签 | <nav> |
内容标签 | <article> |
定义文档某个区域 | <section> |
侧边栏标签 | <aside> |
尾部标签 | <footer> |
新增的多媒体视频标签<video>,一般采用MP4格式,常见属性:
属性 | 值 | 描述 |
autoplay | autoplay | 视频就绪自动播放(谷歌需添加muted) |
controls | controls | 显示播放控件 |
loop | loop | 播放完是否继续播放该视频,循环播放 |
muted | muted | 静音播放 |
poster | Imgurl | 加载等待的画面图片 |
width | 像素(px) | 设置播放器宽度 |
height | 像素(px) | 设置播放器高度 |
新增的多媒体音频标签<audio>,一般采用MP3格式,常见属性:
属性 | 值 | 描述 |
autoplay | autoplay | 音频就绪后马上播放 |
controls | controls | 向用户展示播放控件 |
loop | loop | 循环播放该音乐 |
src | url | 要播放音频的url |
新增的input类型:
属性值 | 说明 |
type="email" | 限制用户输入类型为Email类型 |
type="url" | 限制用户输入类型为URL类型 |
type="date" | 限制用户输入类型为日期类型 |
type="time" | 限制用户输入类型为时间类型 |
type="month" | 限制用户输入类型为月类型 |
type="week" | 限制用户输入类型为周类型 |
type="number" | 限制用户输入类型为数字类型 |
type="tel" | 限制用户输入为手机号码 |
type="search" | 搜索框 |
type="color" | 生成一个颜色选择表单 |
新增的表单属性:
属性 | 值 | 说明 |
required | required | 表示其内容不能为空,必填 |
placeholder | 提示文本(任意值) | 表单提示信息,默认存在值 |
autofocus | autofocus | 页面加载完成后自动聚焦到指定表单 |
multiple | multiple | 可以多选文件提交 |
此外,对于框内文字的溢出,我们采取如下的代码用省略号覆盖代替: