<head> 标签

91 阅读1分钟

包含:title、 base、 meta、 link、 script、 noscript、 和style

  • title

截屏2022-07-13 18.40.57.png

  • meta
    1.<meta charset="utf-8"> 指定文档字符编码
    utf-8 包含了任何人类语言中的大部分的字符,用这个就好了!
    2.<meta name="author" content="Chris Mills">
    name 指定了 meta 元素的类型;说明该元素包含了什么类型的信息。
    content 指定了实际的元数据内容。

指定作者在某些情况下是很有用的:如果你需要联系页面的作者,问一些关于页面内容的问题。一些内容管理系统能够自动获取页面作者的信息,然后用于某些用途。 指定包含关于页面内容的关键字的页面内容的描述是很有用的,因为它可能或让你的页面在搜索引擎的相关的搜索出现得更多。

3.<meta name="description" content="The MDN Web Docs site provides information about Open Web technologies including HTML, CSS, and APIs for both Web sites and progressive web apps.">

截屏2022-07-13 19.40.19.png 4.<meta property="og:image" content="https://developer.mozilla.org/static/img/opengraph-logo.png"> <meta property="og:description" content="The Mozilla Developer Network (MDN) provides information about Open Web technologies including HTML, CSS, and APIs for both Web sites and HTML5 Apps. It also documents Mozilla products, like Firefox OS."> <meta property="og:title" content="Mozilla Developer Network">

截屏2022-07-13 19.44.53.png

  • link
    1.页面添加图标<link rel="icon" href="favicon.ico" type="image/x-icon">