html5新标签及废弃元素

html5新标签

<canvas> 新元素

标签描述
<canvas> 标签定义图形,比如图表和其他图像。该标签基于 JavaScript 的绘图 API

新多媒体元素

标签描述
<audio> 定义音频内容
<video> 定义视频(video 或者 movie)
<source> 定义多媒体资源 <video> 和 <audio>
<embed> 定义嵌入的内容,比如插件。
<track> 为诸如 <video> 和 <audio> 元素之类的媒介规定外部文本轨道。

新表单元素

标签描述
<datalist> 定义选项列表。请与 input 元素配合使用该元素,来定义 input 可能的值。
<keygen> 规定用于表单的密钥对生成器字段。
<output> 定义不同类型的输出,比如脚本的输出。

新的语义和结构元素

标签描述
<article> 定义页面独立的内容区域。
<aside> 定义页面的侧边栏内容。
<bdi> 允许您设置一段文本,使其脱离其父元素的文本方向设置。
<command> 定义命令按钮,比如单选按钮、复选框或按钮
<details> 用于描述文档或文档某个部分的细节
<dialog> 定义对话框,比如提示框
<summary> 标签包含 details 元素的标题
<figure> 规定独立的流内容(图像、图表、照片、代码等等)。
<figcaption> 定义 <figure> 元素的标题
<footer> 定义 section 或 document 的页脚。
<header> 定义了文档的头部区域
<mark> 定义带有记号的文本。
<meter> 定义度量衡。仅用于已知最大和最小值的度量。
<nav> 定义导航链接的部分。
<progress> 定义任何类型的任务的进度。
<ruby> 定义 ruby 注释(中文注音或字符)。
<rt> 定义字符(中文注音或字符)的解释或发音。
<rp> 在 ruby 注释中使用,定义不支持 ruby 元素的浏览器所显示的内容。
<section> 定义文档中的节(section、区段)。
<time> 定义日期或时间。
<wbr> 规定在文本中的何处适合添加换行符。

html5废弃元素

表现性元素

下面的元素被废弃的原因是用CSS处理可以更好地替代他们:

  1. basefont
  2. big
  3. center
  4. font
  5. strike
  6. tt

框架类元素

下面的元素被废弃的原因是他们的使用破坏了可使用性和可访问性(但html5支持iframe):

  1. frame
  2. frameset
  3. noframes

其他

下面的元素被废弃的原因是不经常使用他们,也会引起混乱,而且其它元素也可以很好地实现他们的功能:

  • acronym被废弃是因为它经常使页面错乱,可以使用abbr代替
  • applet被废弃是因为可以使用object代替
  • isindex被废弃是因为使用表单控件代替
  • dir被废弃是因为使用ul代替

html5废弃属性

对应替代方案:https://html.spec.whatwg.org/multipage/obsolete.html#non-conforming-features

对应元素

属性名称

link, a

rev, charset

a

shape, coords

img, iframe

longdesc

link

target

area

nohref

head

profile

html

version

img

name

meta

scheme

object

archive, classid, codebase, codetype, declare, standby

param

valuetype, type

td, th

axis, abbr

td

scope

table

summary

以下元素的视觉属性也被废弃,可用CSS来代替:

对应元素

属性名称

caption, iframe, img, input, object, legend, table, hr, div, h1, h2, h3, h4, h5, h6, p, col, colgroup, tbody, td, tfoot, th, thead, tr

align

body

alink, link, text, vlink

body

background

table, tr, td, th, body

bgcolor

object

border

table

cellpadding, cellspacing

col, colgroup, tbody, td, tfoot, th, thead, tr

char, charoff

br

clear

dl, menu, ol, ul

compact

table

frame

iframe

frameborder

td, th

height

img, object

hspace, vspace

iframe

marginheight, marginwidth

hr

noshade

td, th

nowrap

table

rules

iframe

scrolling

hr

size

li, ol, ul

type

col, colgroup, tbody, td, tfoot, th, thead, tr

valign

hr, table, td, th, col, colgroup, pre

width

 参考资料:http://blog.csdn.net/u013948191/article/details/46953643

     http://yanue.net/post-106.html

     http://www.runoob.com/html/html5-new-element.html

转载请注明出处:丝瓜 » html5新标签及废弃元素

原文地址:https://www.cnblogs.com/zhengshihui/p/6868944.html