> For the complete documentation index, see [llms.txt](https://avincheng.gitbook.io/notebook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://avincheng.gitbook.io/notebook/web/html/html-chang-yong-dtd-sheng-ming.md).

# HTML 常用 DTD 声明

## HTML 5

```markup
<!DOCTYPE html>
```

HTML5 模式下，自闭合标签不需要手动闭合（不需要加反斜杠），但是兼容手动闭合写法。

## HTML 4.01

```markup
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
```

HTML 4.01 Frameset，该 DTD 包含所有 HTML 元素和属性，包括展示性的和弃用的元素（比如 font），且允许框架集（Framesets）。

## 参考文献

* [HTML \<!DOCTYPE> 标签](https://www.w3school.com.cn/tags/tag_doctype.asp)
* [HTML 元素和有效的 DTD](https://www.w3school.com.cn/tags/html_ref_dtd.asp)
