English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
已废弃的 HTML 目录元素( <dir>)被作为一个文件和/或文件夹的目录的容器,可能还有 用户代理 应用的样式与图标。 不要使用这个元素。虽然它出现在早期的 HTML 规范中,它已经在 HTML4 中废除了,并且在 HTML5 中过时。使用 <ul> 来代替。
目录列表:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>基础教程(oldtoolbag.com)</title> </head> <body> <dir> <li>html</li> <li>xhtml</li> <li>css</li> </dir> </body> </html> </html>测试看看 ‹/›
IEFirefoxOperaChromeSafari
所有主流浏览器都支持 <dir> 标签。
HTML5 不支持 <dir> 标签。请用 CSS 代替。
In HTML 4.01 中,<dir> 元素 已废弃。
<dir> 标签被用来定义目录列表。
提示:请使用 CSS 来为列表添加样式!在我们的 CSS 教程中,您可以找到更多有关为列表添加样式的细节。
HTML5 不支持 <dir> 标签,HTML 4.01 已废弃 <dir> 标签。
Attribute | Value | Description |
---|---|---|
compact | compact | HTML5 不支持。HTML 4.01 已废弃。 指定列表必须比常规状态小一号呈现。 |
In HTML 4.01 中,<dir> 标签支持如下标准属性:
Attribute | Value | Description |
---|---|---|
class | classname | 指定元素的类名 |
dir | rtl ltr | 指定元素中内容的文本方向 |
id | id | Specify the unique id of the element |
lang | language_code | Specify the language code for the content of the element |
style | style_definition | Specify the inline style of the element |
title | text | Specify additional information for the element |
For a complete description, please visitStandard Attributes.
In HTML 4.01 In, the <dir> tag supports the following event attributes:
Attribute | Value | Description |
---|---|---|
onclick | script | Execute script when the mouse is clicked |
ondblclick | script | Execute script when the mouse is double-clicked |
onmousedown | script | Execute script when the mouse button is pressed |
onmousemove | script | Execute script when the mouse pointer moves |
onmouseout | script | Execute script when the mouse pointer leaves an element |
onmouseover | script | Execute script when the mouse pointer hovers over an element |
onmouseup | script | Execute script when the mouse button is released |
onkeydown | script | Execute script when the keyboard is pressed |
onkeypress | script | Execute script when the keyboard is pressed and then released |
onkeyup | script | Execute script when the keyboard is released |
For a complete description, please visitEvent Attributes.