HTML 元信息标签
2025-05-14
5️⃣ HTML5 新属性
⚠️ 大多数浏览器不支持
<head>
- 所有头部元素的容器。
- 必须包含文档的标题(title),可以包含脚本、样式、meta 信息 以及其他更多的信息。
<head>
<meta charset="utf-8">
<title>文档标题</title>
</head><meta>
- 元数据(Metadata)是数据的数据信息。
- 通常用于指定网页的描述,关键词,文件的最后修改时间,作者及其他元数据。
| 属性名 | 值 | 说明 |
|---|---|---|
| content | text | 定义与 http-equiv 或 name 属性相关的元信息。 |
| http-equiv | content-type default-style refresh | 把 content 属性关联到 HTTP 头部。 |
| name | application-name author description generator keywords | 把 content 属性关联到一个名称。 |
<head>
<meta name="description" content="免费在线教程">
<meta name="keywords" content="HTML,CSS,XML,JavaScript">
<meta name="author" content="runoob">
<meta charset="UTF-8">
</head><base>
- 为页面上的所有的相对链接规定默认 URL 或默认目标。
| 属性名 | 值 | 说明 |
|---|---|---|
| href | URL | 规定链接的目标 URL。 |
| target | _blank 新窗口打开 _self 当前窗口打开 _parent 父窗口打开 _top 顶层窗口打开 | 规定在何处打开 action URL。 |
<basefont> ⚠️
- HTML5不再支持。 HTML 4.01 已废弃