Head 配置项

< head> 标签用于定义文档的头部

下面这些标签可用在 head 部分

< base>

该标签为页面上的所有链接规定默认地址或默认目标,使用指定的基本 URL 来解析所有的相对 URL。这其中包括 < a>、< img>、< link>、< form> 标签中的 URL


<html>
  <head>
    <base href="https://www.baidu.com" target="_self" />
  head>
  <body>
    <img src="/img/bd_logo1.png" />
    <p><a href="/">百度a>p>
  body>
html>

< link>

定义文档与外部资源的关系






<link rel="stylesheet" href="theme.css" />


<link rel="icon" href="icon.png" />





<link rel="stylesheet" href="print.css" media="screen and (max-width: 600px)" />




<link rel="stylesheet" type="text/css" href="theme.css" />

< meta>

元素可提供有关页面的元信息(meta-information),比如针对搜索引擎和更新频度的描述和关键词,其中 http-equiv 会加入到 http 头中


<meta charset="utf-8" />



------------------------------Content-Security-Policy-----------------------------


<meta http-equiv="Content-Security-Policy" content="default-src https:" />



<meta
  http-equiv="Content-Security-Policy"
  content="script-src http://127.0.0.1:8100 https://www.baidu.com 'unsafe-inline'"
/>

<meta
  http-equiv="Content-Security-Policy"
  content="img-src  https://www.baidu.com "
/>

<meta http-equiv="Content-Security-Policy" content="defaule-src  'self'" />



------------------------------content-type-----------------------------

<meta http-equiv="content-type" content="text/html" />

------------------------------refresh-----------------------------

<meta http-equiv="refresh" content="3 'http://www.baidu.com'" />



------------------------------author-----------------------------

<meta name="author" content="龙龙老表" />

------------------------------description-----------------------------

<meta name="description" content="你好,世界" />

------------------------------keywords-----------------------------

<meta name="keywords" content="你好,世界,ahaha" />

------------------------------referrer-----------------------------



<meta name="referrer" content="no-referrer" />


<meta name="referrer" content="origin" />

------------------------------robots-----------------------------



<meta name="robots" content="index" />


<meta name="robots" content="noindex" />


<meta name="robots" content="noimageindex" />


<meta name="robots" content="follow" />


<meta name="robots" content="nofollow" />


<meta name="robots" content="noindex,nofollow" />


<meta name="robots" content="none" />

------------------------------viewport-----------------------------


<meta name="viewport" content="width=200px" />


<meta name="viewport" content="height=200px" />


<meta name="viewport" content="initial-scale=1" />


<meta name="viewport" content="user-scalable=no" />

< style>

标签用于为 HTML 文档定义样式信息,type 定义 style 元素的内容一般就是 “text/css”

< title>

定义文档的标题

你可能感兴趣的:(HTML+CSS)