deprecated tags in html

巴扎黑
Release: 2017-04-09 09:59:59
Original
1958 people have browsed it

Those deprecated html tags

acronym

initials, such as

Similar is the abbr tag, which represents the abbreviation of a word, such as inc.. The syntax is as follows:

<acronym title="World Wide Web">WWW</acronym>
<abbr title="incorporated">inc.</abbr>
Copy after login

It is recommended to use abbr instead of acronym (ignoring the semantic differences mentioned above)

applet

Java small application, mainly provides drawing function (draw something on the page through code), for example:

<applet code="ShowImage.class" width=600 height=400 archive="Imagetest.jar"></applet>
Copy after login

It is almost useless at present, because JRE is required to run, and currently mainstream browsers do not install JRE by default

It is recommended to use canvas for drawing, or use object+embed to embed flash instead of applet

Note: Using object+embed is for better compatibility. If the scenario allows, it is recommended to use object

basefont

The basefont tag defines the base font. This tag defines the default font color, font size, and font family for all text in the document, for example:

<basefont color="red" size="5" face="Arial" />
Copy after login

The basefont tag is only supported by [IE9-]

It is recommended to define the default font directly for the body element, and all child elements will inherit these attribute values

bgsound

Used to add background music, for example:

<bgsound src="your.mid" autostart="true" loop="infinite">
Copy after login

It is recommended to use audio or object+embed instead, for example:

<embed src="your.mid" autostart="true" loop="true" hidden="true">
Copy after login

big

Used to enlarge the font, enlarge one size (nesting multiple layers can enlarge more), unsupported browsers display bold, for example:

<big>大1号</big><big><big>大2号</big></big>
Copy after login

As for how "number" is defined, don't worry about it. It is not recommended. It is recommended to use em, strong or a custom style class instead

according to the semantics. blink

Flashing effect can be achieved, for example:

<blink>Why would somebody use this?</blink>
Copy after login

The support is very poor and is not recommended. It is also not recommended (major browsers support the blink value, but it has no effect):

<p style="text-decoration: blink">This should be avoided as well.</p>
Copy after login

It is recommended to use animation instead of

center

Center the content, for example:

<center>文本及子元素会居中</center>
Copy after login

The effect is similar to CSS:

text-align: center;
Copy after login

Not recommended, there really is no reason to use it

dir

Directory listing, for example:

<dir>
    <li>html</li>
    <li>xhtml</li>
    <li>css</li>
</dir>
Copy after login

The effect is basically the same as ul. There are slight differences in the left margin of the list items under the browser's default style

Not recommended. It is recommended to use ul, ol or dl

according to the semantics. font

Used to define font, font size and color, for example:

<font face="verdana" color="green" size="3">This is some text!</font>
Copy after login

The attribute value is the same as basefont

It is not recommended to use it. It is recommended to use CSS instead. There is no reason to use this tag

frame

Use frameset columns, for example:

<!DOCTYPE html>
<html>

<frameset cols="25%,*,25%">
  <frame src="frame_a.htm">
  <frame src="frame_b.htm">
  <frame src="frame_c.htm">
</frameset>

</html>
Copy after login

Note: Replace body

with frameset Complex background pages will use frameset+frame layout. Of course, float/flex+Ajax can also be used to implement it, depending on the specific scenario

frameset

See frame

hgroup

Group a series of titles, for example:

<hgroup>
   <h1>The reality dysfunction</h1>
   <h2>Space is not the only void</h2>
</hgroup>
Copy after login

Although it provides a little semantics, it is deprecated because it is outdated.

It is recommended to use header instead, for example:

<header>
   <h1>The reality dysfunction</h1>
   <p class="subheading">Space is not the only void</p>
</header>
Copy after login

isindex

Single line text control, initial display prompt value, for example:

<isindex prompt="string" />
Copy after login

The current support is very poor and is not recommended. It is recommended to use input elements instead

W3C recommends never to use:

No, really, don’t use it. This element is deprecated. It is not implemented anymore.

Quoted from W3C wiki

For specific usage, please refer to http://reference.sitepoint.com/html/isindex (hard to find, so put it here)

listing

No matter what it is, Microsoft doesn’t recommend using it:

This element is obsolete and should no longer be used. Use HTMLPreElement, code or CSS instead. Renders text in a fixed-width font.

Quoted from MSDN listing element | listing object

marquee

Rolling subtitles, the effect is very powerful, for example:

<marquee style="height: 104px; width: 22.35%; margin: 10px 20px; background-color: rgb(204, 255, 255);" 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>
Copy after login

For more effects, please refer to the detailed explanation of the mobile label (marquee) attribute

It is mostly used to implement announcements. Although it is outdated, the effect is indeed powerful and the support is good. For more exciting content, follow the WeChat public account: Full Stack Developer Center (admin10000_com)

multicol

Used to implement multi-column layout. It is not recommended. It is not supported by any mainstream browser

The HTML

Quoted from MDN multicol

nextid

Unknown function, unknown support, not recommended

nobr

Line breaks are prohibited, for example:

<p>Our telephone number is <nobr>0800 123 123 123</nobr>.</p>
Copy after login

Not recommended, it is recommended to use CSS instead:

white-space: nowrap;
Copy after login

noembed

When the browser does not support embed, the content is displayed, similar to noscript, for example:

<noembed>
<img src="/images/inflate.jpg" alt="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>
Copy after login

Not recommended. If compatibility needs to be considered, it is recommended to use object+embed+noembed (embed/noembed as the fallback of object)

noframes

When the browser does not support frameset+frame, the content is displayed, similar to noscript, for example:

<html>

<frameset cols="25%,50%,25%">
  <frame src="frame_a.htm">
  <frame src="frame_b.htm">
  <frame src="frame_c.htm">
  <noframes>Sorry, your browser does not handle frames!</noframes>
</frameset>

</html>
Copy after login

The noframe tag can contain any tag that can appear in the body

If compatibility needs to be considered, it can be used as the fallback of the frame. It is recommended to use float/flex+Ajax to implement it and decide according to the specific scenario

plaintext

忽略内容中的html标签,作用类似于pre,例如:

<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>
Copy after login

不推荐使用,建议根据语义用pre或者code代替

spacer

插入空白(white spaces),例如:

<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>
Copy after login

主流浏览器都不支持,不推荐使用

strike

删除线,效果类似于del和s,例如:

<p>Version 2.0 is <strike>not yet available!</strike> now available!</p>
Copy after login

不推荐使用,建议用del代替

tt

键盘输入(teletype),例如:

<p><tt>Teletype text</tt></p>
Copy after login

不推荐使用,建议根据语义用kbd(键盘按键)、var(变量)、code(代码)、samp(样例输出)或者CSS代替

xmp

80列的样例输出,样式效果类似于pre,语义类似于samp,例如:

<xmp>
Stock ID    Description             Price         Quantity in Stock
--------    -----------             -----         -----------------
116         Inflatable Armchair     21.50                13
119         Walkie Talkie           40.20                44
</xmp>
Copy after login

目前浏览器支持该标签,但不限制80列

不推荐使用,建议采用samp代替

The above is the detailed content of deprecated tags in html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!