基础
标题
<h></h> 从h1——h6- 1.保证h1只使用一次
- 2.按顺序表示
- 3.每个页面最好不超过三个标题
段落
<p></p>- 1.p后面接数字无影响
- 2.段落里连续多个空格或换行最终只会变成一个
- 3.可以使用
 占位(可连续占位) - 4.
可用于换行,无闭合标签,虽然标签<br>与<br/>作用相同,但<br>不符合标准。(注:自闭合标签>前都加上/才符号w3c标准。)
主体
<body></body>- 1.文档主体部分,即可显示部分
注释
<!--注释内容-->
元信息
<meta>标签
属性
name属性
name属性主要用于描述网页,与之对应的属性值为content,content中的内容主要是便于搜索引擎机器人查找信息和分类信息用的。
<meta name="参数” content="参数值">
http-equiv属性
http-equiv顾名思义,相当于http的文件头作用,它可以向浏览器传回一些有用的信息,以帮助正确和精确地显示网页内容,与之对应的属性值为content,content中的内容其实就是各个参数的变量值。
<meta http-equiv="参数“ content="参数值">
name属性参数
Keywords
keywords用来告诉搜索引擎你网页的关键字是什么。
- 例:
<meta name="keywords" content="science,education,culture">
- 例:
description
description用来告诉搜索引擎你的网站主要内容。
- 例:
<meta name="description" content="This page is about the science">
- 例:
robots
robots用来告诉搜索机器人哪些页面需要索引,哪些页面不需要索引。
content的参数有all,none,index,noindex,follow,nofollow。默认是all。- 例:
<meta name="robots" content="none">
- 例:
author
标注网页的作者
- 例:
<meta name="autor" content="怪默呀”>
- 例:
http-equiv属性参数
Expires
用于设定网页的到期时间。一旦网页过期,必须到服务器上重新传输。
必须使用GMT时间格式- 例:
<meta http-equiv="expires" content="Fri , 12 Jun 2020 23:14:53 GMT">
- 例:
Pragma(cache模式)
禁止浏览器从本地计算机的缓存中访问页面内容。
这样设定,访问者将无法脱机浏览。- 例:
<meta http-equiv="Pragma" content="no-cache">
- 例:
Refresh
自动刷新并指向新页面。
例:
<meta http-equiv="Refresh" content="2;URL=http://www.seaantwh.top">其中的2是指停留2秒钟后自动刷新到URL网址。
Set-Cookie
cookie设定
如果网页过期,那么存盘的cookie将被删除。
必须使用GMT的时间格式。- 例:
<meta http-equiv="Set-Cookie" content="cookievalue=xxx;expires=Friday, 12-Jun-2020 23:24:25 GMT;path=/">
- 例:
Window-target
强制页面在当前窗口以独立页面显示。
用来防止别人在框架里调用自己的页面。- 例:
<meta http-equiv="Window-target" content="_top">
- 例:
content-Type
设定页面使用的字符集。
例:
<meta http-equiv="content-Type" content="text/html;charset=gb2312"><metahttp-equiv="Content-Type"content="text/html;charset=信息参数"/>meta标签的charset的信息参数如GB2312时,代表说明网站是采用的编码是简体中文;meta标签的charset的信息参数如BIG5时,代表说明网站是采用的编码是繁体中文;meta标签的charset的信息参数如iso-2022-jp时,代表说明网站是采用的编码是日文;meta标签的charset的信息参数如ks_c_5601时,代表说明网站是采用的编码是韩文;meta标签的charset的信息参数如ISO-8859-1时,代表说明网站是采用的编码是英文;meta标签的charset的信息参数如UTF-8时,代表世界通用的语言编码;
content-Language
显示语言的设定
- 例:
<meta http-equiv="Content-Language" content="zh-cn"/>
- 例:
Cache-Control
Cache-Control指定请求和响应遵循的缓存机制。
在请求消息或响应消息中设置Cache-Control并不会修改另一个消息处理过程中的缓存处理过程。
请求时的缓存指令包括no-cache、no-store、max-age、max-stale、min-fresh、only-if-cached。
响应消息中的指令包括public、private、no-cache、no-store、no-transform、must-revalidate、proxy-revalidate、max-age。指令具体·含义
Public指示响应可被任何缓存区缓存
Private指示对于单个用户的整个或部分响应消息,不能被共享缓存处理。这允许服务器仅仅描述当用户的部分响应消息,此响应消息对于其他用户的请求无效 。
no-cache指示请求或响应消息不能缓存
no-store用于防止重要的信息被无意的发布。在请求消息中发送将使得请求和响应消息都不使用缓存。
max-age指示客户机可以接收生存期不大于指定时间(以秒为单位)的响应
min-fresh指示客户机可以接收响应时间小于当前时间加上指定时间的响应
max-stale指示客户机可以接收超出超时期间的响应消息。如果指定max-stale消息的值,那么客户机可以接收超出超时期指定值之内的响应消息。
<title></title>标签
- 显示在浏览器标题栏或标签页
- 包含在
<head></head>里,只能有一个
<link>标签
自定义图标
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon/png">其他类型:
<!-- third-generation iPad with high-resolution Retina display: --><link rel="apple-touch-icon-precomposed" sizes="144x144" href="https://developer.cdn.mozilla.net/static/img/favicon144.a6e4162070f4.png"><!-- iPhone with high-resolution Retina display: --><link rel="apple-touch-icon-precomposed" sizes="114x114" href="https://developer.cdn.mozilla.net/static/img/favicon114.0e9fabd44f85.png"><!-- first- and second-generation iPad: --><link rel="apple-touch-icon-precomposed" sizes="72x72" href="https://developer.cdn.mozilla.net/static/img/favicon72.8ff9d87c82a0.png"><!-- non-Retina iPhone, iPod Touch, and Android 2.1+ devices: --><link rel="apple-touch-icon-precomposed" href="https://developer.cdn.mozilla.net/static/img/favicon57.a2490b9a2d76.png"><!-- basic favicon --><link rel="shortcut icon" href="https://developer.cdn.mozilla.net/static/img/favicon32.e02854fdcf73.png">
CSS样式表
-
<link href="main.css" rel="stylesheet">其它