网页的头部都装点什么

一.网页的基本组成

<!DOCTYPE html>
<html>
<head>
    <title>这是标题</title>
    <meta charset="utf-8">
    <meta name="author"  content="作者xxx">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
</head>
<body>

</body>
</html>

二.网页的头部组成

     网页的头部一般首先都应该有标题:

<title>这是一个标题</title>

  标题一般都是浏览器打开网页时中的栏目主题

   

   第二个参数就是网页的编码:

<meta charset="UTF-8">

  charset参数就是编码格式,UTF-8国际通用

 还可以统一设置默认的链接地址

<base href="https://www.51zxw.net/study.asp?vip=15952049" target="_blank">

这样默认的<a>链接就也有链接了

三.meta参数name

其中<meta>标签除了有charset属性,还有namehttp-equiv

    name(参数):                                                       

  •  author
  • description
  • keywords
  • robots
  • renderer
  • viewport
  • generator
  • copyright
  • revisit-after
  •  author
<meta name="author" content="这里是作者信息,包括姓名或者联系方式">          <!--作者及其信息-->
  •  description
<meta name="description" content="通过写代码,学习编程,向企业级迈进">  <!--网站内容及其描述-->
  • keywords
<meta name="keywords" content="学习,H5,前端,网页,企业,代码">         <!--关键字-->
  • robots
<meta name="robots" content="none">                            <!--机器人搜索模式-->

     robotscontent内容就没有那么随意,不随意必然会固定参数,那么都有什么呢?

 信息参数为all:文件将被检索,且页面上的链接可以被查询;
 信息参数为none:    
 信息参数为index:文件将被检索;
 信息参数为follow:页面上的链接可以被查询;
 信息参数为noindex:文件将不被检索,但页面上的链接可以被查询;
 信息参数为nofollow:文件将被检索,但页面上的链接不可以被查询;
  •  renderer
 <meta name="renderer" content="webkit">     <!--告诉浏览器你的渲染模式-->
  • viewport
<meta name="viewport" content="width=device-width,initial-scale=1"/>      <!--视图模式-->
  •      generator
<meta name="generator" content="sublime"/>          <!--meta标签的generator的信息参数,代表说明网站的采用的什么软件制作。-->           
  • copyright
 <meta name="copyright" CONTENT="版权信息">       <!--meta标签的COPYRIGHT的信息参数,代表说明网站版权信息。-->

    

  • revisit-after
<meta name="revisit-after" CONTENT="7days">      <!--revisit-after代表网站重访,7days代表7天,依此类推。-->

   

四.meta参数http-equiv

name(参数):

  •    X-UA-Compatible
  •    expires
  •    Pragma
  •    Refresh
  •    Set-Cookie
  •    Window-target
  •    content-Type
  •   Content-Language
  •   Content-Script-Type
  •   imagetoolbar
  • X-UA-Compatible

     

<meta http-equiv="X-UA-Compatible" content="IE=edge">      <!--浏览模式-->  <!--IE8浏览器-->

    

  •     expires
    <meta http-equiv="expires"content="Fri,01Jan201618:18:18GMT">     <!--说明:可以用于设定网页的到期时间。一旦网页过期,必须到服务器上重新传输。-->
  •      Pragma
 <meta http-equiv="Pragma" content="no-cache">       <!--说明:禁止浏览器从本地计算机的缓存中访问页面内容。-->
  •    Refresh
<meta http-equiv="Refresh" content="2;URL=http://www.baidu.com">   <!--说明:自动刷新并指向新页面。-->
  • Set-Cookie
<meta http-equiv="Set-Cookie"content="cookievalue=xxx;expires=Friday,12-Jan-200118:18:18GMT;path=/">    <!--说明:如果网页过期,那么存盘的cookie将被删除。-->
  •  Window-target
<meta http-equiv="Window-target" content="_blank">      <!--说明:强制页面在当前窗口以独立页面显示。-->
  •     content-Type
<meta http-equiv="content-Type" content="text/html;charset=gb2312">          <!--说明:设定页面使用的字符集。-->
  •   Content-Language
<meta http-equiv="Content-Language" content="zh-cn"/>

   

  •     Content-Script-Type
<Meta http-equiv="Content-Script-Type" Content="text/javascript">        <!--W3C网页规范,指明页面中脚本的类型。-->
  •      imagetoolbar
<meta http-equiv="imagetoolbar" content="false"/>         <!--指定是否显示图片工具栏,当为false代表不显示,当为true代表显示。-->

 

  

M54
原文地址:https://www.cnblogs.com/Crown-V/p/12259666.html