HTML5 那些离我们远去的HTML标签, 废弃的HTML5标签
2016-10-27 09:38
323 查看
HTML 已经发展了多年,现在 W3C 已经发布了 HTML 5.1 的提案推荐标准,一些陈旧废弃的标签已经在后继的标准中逐渐消失。这里为大家列出那些已经被废弃 HTML 标签,看看你是不是还在使用它们。
<acronym>
<acronym title="World Wide Web">WWW</acronym>
<abbr title="incorporated">inc.</abbr>
<applet>
<basefont>
<bgsound>
<big>
<blink>
<center>
<dir>
<font>
<frame>
<!DOCTYPE html><html><frameset cols="25%,*,25%">
<frame src="frame_a.htm" rel="nofollow" target="_blank" >
<frame src="frame_b.htm" rel="nofollow" target="_blank" >
<frame src="frame_c.htm" rel="nofollow" target="_blank" ></frameset></html>
<frameset>
<hgroup>
<isindex>
<listing>
<marquee>
<marquee bgcolor="#ccffff" vspace="10" direction="up" height="104" width="22.35%" loop="3" scrollamount="1" scrolldelay="10" hspace="20"><p align="center"><font color="#000000">此处输入滚动内容</font></p></marquee><marquee>这里是输入文字的地方,还可以放图片代码、Flash动画代码和gif动态小图代码。</marquee>
<multicol>
<nextid>
<nobr>
<p>Our telephone number is <nobr>0800 123 123 123</nobr>.</p>
white-space: nowrap;
<noembed>
<noembed>
<img src="/images/inflate.jpg" alt=" rel="nofollow" target="_blank" Inflate the tyre by holding the
pump at 90 degree angle to the valve">
<p>You can inflate the tyre by holding the pump at 90 degree angle
to the valve, as shown in the image above.</p>
</noembed>
<noframes>
html>
<frameset cols="25%,50%,25%">
<frame src="frame_a.htm" rel="nofollow" target="_blank" >
<frame src="frame_b.htm" rel="nofollow" target="_blank" >
<frame src="frame_c.htm" rel="nofollow" target="_blank" >
<noframes>Sorry, your browser does not handle frames!</noframes>
</frameset>
</html>
<plaintext>
<p>The markup for this is:</p>
<plaintext>
<h1>Main heading goes here</h1>
<p>First paragraph goes here</p>
<h2>Sub-heading goes here</h2>
</plaintext>.
</body>
</html>
<spacer>
<span>Just a text node</span>
<spacer type="horizontal" size="10"></spacer>
<span>Just another text node</span>
<spacer type="block" width="10" height="10"></spacer>
<strike>
<tt>
<xmp>
<xmp> Stock ID Description Price Quantity in Stock -------- ----------- ----- ----------------- 116 Inflatable Armchair 21.50 13 119 Walkie Talkie 40.20 44 </xmp>
Stock ID Description Price Quantity in Stock
-------- ----------- ----- -----------------
116 Inflatable Armchair 21.50 13
119 Walkie Talkie 40.20 44
</xmp>
首字母缩写,例如 WWW
类似的有<abbr>标签,表示单词缩写,例如 <abbr>inc.</abbr>。语法如下:
推荐用<abbr>,不要用<acronym>(忽略上面提到的语义上的差异)。
Java 小应用程序,主要提供绘图功能(在页面上通过代码绘制一些东西),例如:
<applet code="ShowImage.class" width=600 height=400 archive="Imagetest.jar"></applet>
目前几乎没什么用了,因为运行需要 JRE,而目前主流浏览器并不默认安装 JRE。
推荐使用<canvas>绘图,或者用<object>+<embed>嵌入 flash代替<applet>。
注意:使用<object>+<embed>是为了更好的兼容性,如果场景允许,推荐使用<object>。
<basefont>标签定义基准字体。该标签可以为文档中的所有文本定义默认字体颜色、字体大小和字体系列,例如:
<basefont color="red" size="5" face="Arial" />
<basefont>标签只有 IE 支持。
推荐直接给<body>元素定义默认字体,所有子元素都会继承这些属性值。
用来添加背景音乐,例如:
<bgsound src="your.mid" autostart="true" loop="infinite" rel="nofollow" target="_blank" >
推荐使用<audio>或者<object>+<embed>来代替,例如:
<embed src="your.mid" autostart="true" loop="true" hidden="true" rel="nofollow" target="_blank" >
用来放大字体,放大一号(嵌套多层可以放大更多),不支持的浏览器显示粗体,例如:
<big>大1号</big><big><big>大2号</big></big>
至于“号”是怎么定义的就别管了,不推荐使用,建议根据语义采用<em>、<strong>或者自定义样式类代替。
可以实现闪烁效果,例如:
<blink>Why would somebody use this?</blink>
支持性很差,不推荐使用,同样不推荐使用(各大浏览器支持<blink>,但没有任何效果):
<p>This should be avoided as well.</p>
建议采用<animation>代替
使内容居中,例如:
<center>文本及子元素会居中</center>
效果类似于如下 CSS:
text-align: center;
不建议使用,确实没有任何理由去用。
目录列表,例如:
<dir> <li>html</li> <li>xhtml</li> <li>css</li></dir>
效果和<ul>基本相同,浏览器默认样式下列表项的左边距有细微差异。
不推荐使用,建议根据语义采用<ul>、<ol>或者<dl>。
用来定义字体、字号和颜色,例如:
<font face="verdana" color="green" size="3">This is some text!</font>
属性值和<basefont>一样。
不推荐使用,建议用 CSS 代替,没理由用这个标签。
配合<frameset>分栏,例如:
注意:用<frameset>替换掉<body>。
复杂的后台页面会用到<frameset>+<frame>布局,当然也可以采用 float/flex+Ajax 实现,根据具体场景来定。
见<frame>。
给一系列标题分组,例如:
<hgroup> <h1>The reality dysfunction</h1> <h2>Space is not the only void</h2></hgroup>
虽然提供了一点语义,但因为已经过时,所以不推荐使用。
建议采用<header>代替,例如:
<header> <h1>The reality dysfunction</h1> <p class="subheading">Space is not the only void</p></header>
单行文本控件,初始显示prompt属性值,例如:
<isindex prompt="string" />
目前支持性很差,不推荐使用,建议用<input>元素代替。
W3C 建议千万不要用:
No, really, don’t use it. This element is deprecated. It is not implemented anymore.
具体用法可以参考 http://reference.sitepoint.com/html/isindex。
不用管它是什么,微软都不建议使用了:
This element is obsolete and should no longer be used. Use HTMLPreElement, code or CSS instead. Renders text in a fixed-width font.
滚动字幕,效果很强大,例如:
多用来实现公告,虽然已经过时了,但效果确实很强大,而且支持性良好。
用来实现多列布局,不建议使用,任何主流浏览器都不曾支持过。
MDN 称其从未被任何主流浏览器支持过:
The HTML element was an experimental element designed to allow multi-column layouts. It never got any significant traction and is not implemented in any major browsers.
作用未知,支持性未知,不建议使用。
禁止换行,例如:
不推荐使用,建议用 CSS 代替:
在浏览器不支持<embed>时,显示内容,类似于<noscript>,例如
不推荐使用,如果需要考虑兼容性的话,建议采用<object>+<embed>+<noembed>(embed / noembed 作为 object 的回退)。
在浏览器不支持<frameset>+<frame>时,显示内容,类似于<noscript>,例如:
如果需要考虑兼容性的话,可以作为<frame>的回退,建议采用 float/flex + Ajax 实现,根据具体场景来定。
忽略内容中的html标签,作用类似于<pre>,例如:
不推荐使用,建议根据语义用<pre>或者<code>代替。
插入空白,例如:
删除线,效果类似于<del>和<s>,例如:
<p>Version 2.0 is <strike>not yet available!</strike> now available!</p>
不推荐使用,建议用<del>代替。
键盘输入(teletype),例如:
不推荐使用,建议根据语义用<kbd>(键盘按键)、<var>(变量)、<code>(代码)、<samp>(样例输出)或者CSS代替。
80 列的样例输出,样式效果类似于<pre>,语义类似于<samp>,例如:
目前浏览器支持该标签,但不限制 80 列。
不推荐使用,建议采用<samp>代替。
原文链接
https://www.oschina.net/news/78180/dumped-html-label
<acronym>
<acronym title="World Wide Web">WWW</acronym>
<abbr title="incorporated">inc.</abbr>
<applet>
<basefont>
<bgsound>
<big>
<blink>
<center>
<dir>
<font>
<frame>
<!DOCTYPE html><html><frameset cols="25%,*,25%">
<frame src="frame_a.htm" rel="nofollow" target="_blank" >
<frame src="frame_b.htm" rel="nofollow" target="_blank" >
<frame src="frame_c.htm" rel="nofollow" target="_blank" ></frameset></html>
<frameset>
<hgroup>
<isindex>
<listing>
<marquee>
<marquee bgcolor="#ccffff" vspace="10" direction="up" height="104" width="22.35%" loop="3" scrollamount="1" scrolldelay="10" hspace="20"><p align="center"><font color="#000000">此处输入滚动内容</font></p></marquee><marquee>这里是输入文字的地方,还可以放图片代码、Flash动画代码和gif动态小图代码。</marquee>
<multicol>
<nextid>
<nobr>
<p>Our telephone number is <nobr>0800 123 123 123</nobr>.</p>
white-space: nowrap;
<noembed>
<noembed>
<img src="/images/inflate.jpg" alt=" rel="nofollow" target="_blank" Inflate the tyre by holding the
pump at 90 degree angle to the valve">
<p>You can inflate the tyre by holding the pump at 90 degree angle
to the valve, as shown in the image above.</p>
</noembed>
<noframes>
html>
<frameset cols="25%,50%,25%">
<frame src="frame_a.htm" rel="nofollow" target="_blank" >
<frame src="frame_b.htm" rel="nofollow" target="_blank" >
<frame src="frame_c.htm" rel="nofollow" target="_blank" >
<noframes>Sorry, your browser does not handle frames!</noframes>
</frameset>
</html>
<plaintext>
<p>The markup for this is:</p>
<plaintext>
<h1>Main heading goes here</h1>
<p>First paragraph goes here</p>
<h2>Sub-heading goes here</h2>
</plaintext>.
</body>
</html>
<spacer>
<span>Just a text node</span>
<spacer type="horizontal" size="10"></spacer>
<span>Just another text node</span>
<spacer type="block" width="10" height="10"></spacer>
<strike>
<tt>
<xmp>
<xmp> Stock ID Description Price Quantity in Stock -------- ----------- ----- ----------------- 116 Inflatable Armchair 21.50 13 119 Walkie Talkie 40.20 44 </xmp>
Stock ID Description Price Quantity in Stock
-------- ----------- ----- -----------------
116 Inflatable Armchair 21.50 13
119 Walkie Talkie 40.20 44
</xmp>
首字母缩写,例如 WWW
类似的有<abbr>标签,表示单词缩写,例如 <abbr>inc.</abbr>。语法如下:
推荐用<abbr>,不要用<acronym>(忽略上面提到的语义上的差异)。
Java 小应用程序,主要提供绘图功能(在页面上通过代码绘制一些东西),例如:
<applet code="ShowImage.class" width=600 height=400 archive="Imagetest.jar"></applet>
目前几乎没什么用了,因为运行需要 JRE,而目前主流浏览器并不默认安装 JRE。
推荐使用<canvas>绘图,或者用<object>+<embed>嵌入 flash代替<applet>。
注意:使用<object>+<embed>是为了更好的兼容性,如果场景允许,推荐使用<object>。
<basefont>标签定义基准字体。该标签可以为文档中的所有文本定义默认字体颜色、字体大小和字体系列,例如:
<basefont color="red" size="5" face="Arial" />
<basefont>标签只有 IE 支持。
推荐直接给<body>元素定义默认字体,所有子元素都会继承这些属性值。
用来添加背景音乐,例如:
<bgsound src="your.mid" autostart="true" loop="infinite" rel="nofollow" target="_blank" >
推荐使用<audio>或者<object>+<embed>来代替,例如:
<embed src="your.mid" autostart="true" loop="true" hidden="true" rel="nofollow" target="_blank" >
用来放大字体,放大一号(嵌套多层可以放大更多),不支持的浏览器显示粗体,例如:
<big>大1号</big><big><big>大2号</big></big>
至于“号”是怎么定义的就别管了,不推荐使用,建议根据语义采用<em>、<strong>或者自定义样式类代替。
可以实现闪烁效果,例如:
<blink>Why would somebody use this?</blink>
支持性很差,不推荐使用,同样不推荐使用(各大浏览器支持<blink>,但没有任何效果):
<p>This should be avoided as well.</p>
建议采用<animation>代替
使内容居中,例如:
<center>文本及子元素会居中</center>
效果类似于如下 CSS:
text-align: center;
不建议使用,确实没有任何理由去用。
目录列表,例如:
<dir> <li>html</li> <li>xhtml</li> <li>css</li></dir>
效果和<ul>基本相同,浏览器默认样式下列表项的左边距有细微差异。
不推荐使用,建议根据语义采用<ul>、<ol>或者<dl>。
用来定义字体、字号和颜色,例如:
<font face="verdana" color="green" size="3">This is some text!</font>
属性值和<basefont>一样。
不推荐使用,建议用 CSS 代替,没理由用这个标签。
配合<frameset>分栏,例如:
注意:用<frameset>替换掉<body>。
复杂的后台页面会用到<frameset>+<frame>布局,当然也可以采用 float/flex+Ajax 实现,根据具体场景来定。
见<frame>。
给一系列标题分组,例如:
<hgroup> <h1>The reality dysfunction</h1> <h2>Space is not the only void</h2></hgroup>
虽然提供了一点语义,但因为已经过时,所以不推荐使用。
建议采用<header>代替,例如:
<header> <h1>The reality dysfunction</h1> <p class="subheading">Space is not the only void</p></header>
单行文本控件,初始显示prompt属性值,例如:
<isindex prompt="string" />
目前支持性很差,不推荐使用,建议用<input>元素代替。
W3C 建议千万不要用:
No, really, don’t use it. This element is deprecated. It is not implemented anymore.
具体用法可以参考 http://reference.sitepoint.com/html/isindex。
不用管它是什么,微软都不建议使用了:
This element is obsolete and should no longer be used. Use HTMLPreElement, code or CSS instead. Renders text in a fixed-width font.
滚动字幕,效果很强大,例如:
多用来实现公告,虽然已经过时了,但效果确实很强大,而且支持性良好。
用来实现多列布局,不建议使用,任何主流浏览器都不曾支持过。
MDN 称其从未被任何主流浏览器支持过:
The HTML element was an experimental element designed to allow multi-column layouts. It never got any significant traction and is not implemented in any major browsers.
作用未知,支持性未知,不建议使用。
禁止换行,例如:
不推荐使用,建议用 CSS 代替:
在浏览器不支持<embed>时,显示内容,类似于<noscript>,例如
不推荐使用,如果需要考虑兼容性的话,建议采用<object>+<embed>+<noembed>(embed / noembed 作为 object 的回退)。
在浏览器不支持<frameset>+<frame>时,显示内容,类似于<noscript>,例如:
如果需要考虑兼容性的话,可以作为<frame>的回退,建议采用 float/flex + Ajax 实现,根据具体场景来定。
忽略内容中的html标签,作用类似于<pre>,例如:
不推荐使用,建议根据语义用<pre>或者<code>代替。
插入空白,例如:
删除线,效果类似于<del>和<s>,例如:
<p>Version 2.0 is <strike>not yet available!</strike> now available!</p>
不推荐使用,建议用<del>代替。
键盘输入(teletype),例如:
<p><tt>Teletype text<
/tt
><
/p
>
不推荐使用,建议根据语义用<kbd>(键盘按键)、<var>(变量)、<code>(代码)、<samp>(样例输出)或者CSS代替。
80 列的样例输出,样式效果类似于<pre>,语义类似于<samp>,例如:
目前浏览器支持该标签,但不限制 80 列。
不推荐使用,建议采用<samp>代替。
原文链接
https://www.oschina.net/news/78180/dumped-html-label
相关文章推荐
- html5有哪些新特性、移除了那些元素?如何处理HTML5新标签的浏览器兼容问题?如何区分 HTML 和HTML5?
- HTML4.01与HTML5中四个标签(<b><i><strong><em>)的区分总结
- html5和html4.01没有变化的标签
- HTML与HTML5复习标签汇总
- HTML语义化:HTML5新标签——template
- HTML语义化:HTML5的新标签及IE5.5~9的部分兼容方案
- 废弃的标签,始于HTML3.2
- 你所不知道的html5与html中的那些事(二)
- html5里面的html标签,再啰嗦下
- html5手机网站需要加的那些meta/link标签,html5 meta全解
- 浅谈html语义化标签,Html5新增语义化标签
- HTML5和HTML4.01标签对比一览表
- HTML5/CSS3系列教程:HTML5基本标签使用header,nav和footer
- HTML5/CSS3系列教程:HTML5基本标签使用header,nav和footer
- 转:html常用标签(后续加入html5的标签)
- 别再留恋:那些被 HTML5 弃置的旧标签
- HTML5 入门:一个最简单的HTML页面(doctype、meta、Head、标签的使用)
- html html5 很少用的标签
- 你所不知道的html5与html中的那些事(二)