<meta name=" " content=" " />标签常用功能:

  • 指定浏览器对当前页面的字符集:

    • <!doctype html>
      <html>
      <head>
      <meta charset="utf-8" />
      <title>显示在网页的标题栏</title>
      </head> <body>
      Hello Web!`
      </body>
      </html>
  • 设置网页的关键字:
    • <!doctype html>
      <html>
      <head>
      <meta charset="utf-8" />
      <meta name="keywords" content="html5,javascript,前端,全栈"/>
      <title>设置网页的关键字</title>
      </head> <body>
      Hello Web!`
      </body>
      </html>
  • 指定网页的描述
    • <!doctype html>
      <html>
      <head>
      <meta charset="utf-8" />
      <meta name="description" content="这是用来描述整个网页的。"/>
      <title>指定网页的描述</title>
      </head> <body>
      Hello Web!`
      </body>
      </html>
  • 请求的重定向(url=“可以是相对路径html”)
    • <!doctype html>
      <html>
      <head>
      <meta charset="utf-8" />
      <meta http-equiv="refresh" content="3; url=./cat.html"/>
      <title>请求的重定向(url=“可以是相对路径html”)</title>
      </head> <body>
      Hello Web!`
      </body>
      </html>

必需的属性

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

可选的属性

属性描述
http-equiv
  • content-type
  • expires
  • refresh
  • set-cookie
把 content 属性关联到 HTTP 头部。
name
  • author
  • description
  • keywords
  • generator
  • revised
  • others
把 content 属性关联到一个名称。
schemesome_text定义用于翻译 content 属性值的格式。
05-07 12:55
查看更多