在本文中,我们将看到 HTML5 中各种已弃用的 Html 标签及其替代标签。不推荐使用的标签是那些允许使用但不推荐使用并且正在被更新的标签替换的标签。当以其他方式获得相同的属性时,标记或属性会贬值。被丢弃并使用较新的原因有几个:
- 有几个标签可以帮助完成相同的任务。因此,源代码的长度也减少了,从而提高了整体性能。
- 管理大型代码将很困难,并且不可能立即修改这样的源代码。这会增加开发时间以及代码中的歧义。
- 有时,如果我们需要使用特定的代码块来执行特定任务,则可能会发生这种情况,然后我们可能需要再次重新编写代码。所有这些因素都有助于增加复杂性以及不值得开发过程的开发时间。
为此,HTML5 中引入了几个标签和属性。这是下面讨论的已弃用标签的完整列表。
HTML 5 弃用标签:下面给出了弃用标签的完整列表。
TAGS |
DESCRIPTIONS |
ALTERNATIVE TAGS |
---|---|---|
To Specify a basefont. | font style sheets. | |
It specifies font text, size and color. | font-family, font-size, color. | |
It specifies a centered Text. | text-align:center. | |
It specifies a strike-through text. | text-decoration. | |
Defines big text. | Use CSS properties or Heading tags. | |
It specifies a directory list. | ul tag. | |
It specifies a single-line input field. | form tag. | |
It specifies an applet. | object tag. | |
An acronym is defined using this tag. | Use abbr. | |
It is used to define a noframe section. | Either use an iframe and CSS instead or use server-side include to generate complete pages with the various invariant parts merged in. | |
Renders text between the start and end tags without interpreting the HTML in between and using a monospaced font. | Use pre and code instead. | |
A tag makes it easy to supply alternative content that tells users what they are missing. | Use object instead of embed when fallback is necessary. | |
It is used to render all text in the document exactly as it was typed in. | Use the “text/plain” MIME type instead. | |
It specifies a set of frames. | Either use iframe and CSS instead or use server-side include to generate complete pages with the various invariant parts merged in. | |
It specifies a frame. | Either use iframe and CSS instead or use server-side include to generate complete pages with the various invariant parts merged in. | |
It specifies an underlined text. | text-decoration. | |
Defines teletype text. | Use CSS properties. | |
Specify a strike-through text. | text-decoration. |
HTML 弃用属性:还删除了几个标签属性。以下是删除了属性及其相应受影响标签(元素)的表格,即。这些属性已被永久删除的元素。
REMOVED ATTRIBUTES |
TAGS IMPACTED |
ALTERNATIVES |
---|---|---|
rev | a, link |
Use the rel attribute. |
longdesc | img, iframe |
Use a regular element to link to the description. |
version | Html |
Unnecessary, not required to mention. |
charset | a, link |
Use an HTTP Content-Type header on the linked resource instead. |
name | a, img |
Use the id attribute instead. |
nohref | area |
Omitting the href attribute is sufficient. The nohref attribute is unnecessary, not required to mention. |
usemap | input |
Use img instead of input for image maps. |
target | link |
Unnecessary, not required to mention. |
scheme | meta |
Use only one scheme per field, or make the scheme declaration part of the value. |
codetype | object |
Use the data and type attributes to invoke plugins. |
declare | object |
Repeat the object element completely each time the resource is to be reused. |
standby | object |
Optimise the linked resource so that it loads quickly or, at least, incrementally. |
valuetype | param |
Without declaring value types, use name and value attributes. |
language | script |
Use the type attribute. |
abbr | td, th |
Use text that begins in an unambiguous and terse manner, and include any more elaborate text after that. |
axis | td, th |
Scope attribute should be used. |