0
点赞
收藏
分享

微信扫一扫

#yyds干货盘点# 1.8 HTML5基础 - 元标签

zidea 2022-03-30 阅读 74

六、元标签

  • <meta>元素提供有关页面的元信息(meta-information),如针对搜索引擎和更新频率的描述和关键词。
  • <meta>标签位于文档的头部,不包含任何内容。
  • <meta>标签的属性定义了与文档相关联的名称/值对
<meta http-equiv="..." name="..." content="...">

属性

描述

charset

character encoding

定义文档的字符编码

content

some_text

定义与http-equiv或name属性相关的元信息

http-equiv

content-type、expiress、refresh、set-cookie

把content属性关联到HTTP头部

name

author、description、keywords、generator、revised、others

把content属性关联到一个名称

其中charset属性是HTML5新增的属性

<meta charset="ISO-8859-1">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="author" content="w3school.com.cn">
<meta name="revised" content="JIangShang,8/1/22">
<meta name="generator" content="Dreamweaver 8.0en">
<meta name="description" content="HTML5 examples">
<meta name="keywords" content="HTML5 CSS3 XML XHTML JavaScript">
</head>
<body>
<p>本文档的 meta 属性标识了创作者和编辑软件。</p>
</body>
</html>


举报

相关推荐

0 条评论