head及body

来源:互联网 发布:航天税控发票软件 编辑:程序博客网 时间:2024/06/05 09:46

head:

<head> </head>标签用于定义文档的头部。里面一般有

titlemeta这两个标签。

title 和meta的常见写法:

<head>

<meta http-equiv=”Content-Type” content=”text/html;  charset=gb2312” />

<title>文档标题</title>
<meta name=”keywords” content=”网页描述”>
<meta name=”description” content=”关键词”>

</head>

 
meta标签共有两个属性,它们分别是http-equiv属性和name属性,不同的属性又有不同的参数值,这些不同的参数值就实现了不同的网页功能。
Name属性:
name属性语法格式是:
<meta name="参数" content="具体的参数值">
Name属性的常用参数:
Keywords(关键字):告诉搜索引擎你网页的关键字是什么
例:
<meta name ="keywords" content="science,education,culture,politics,ecnomics,relationships,entertainment,human">
description(网站内容描述):告诉搜索引擎你的网站主要内容
例:
<meta name="description" content="This page is about the meaning of science,education,culture.">
 
robots(机器人向导):告诉搜索机器人哪些页面需要索引,哪些页面不需要索引。

content的参数有all,none,index,noindex,follow,nofollow。默认是all

例:<meta name="robots" content="none">

 
author(标注网页作者)
 

http-equiv属性:

http-equiv属性语法格式是:
<meta http-equiv="参数" content="参数变量值">
http-equiv的常用参数:
①  content-Type(显示字符集的设定):
例:
<meta http-equiv="content-Type" content="text/html; charset=gb2312">
 

表格 1常用编码

charset
对应编码
GB2312
简体中文
BIG5
繁体中文
ISO-8859-1
英文
UTF-8
世界通用的语言编码
ks_c_5601
韩文
iso-2022-jp
日文
 
 
②  content-Language显示语言的设定):
例:
<meta http-equiv="Content-Language" content="zh-cn" />
 
③  Refresh(刷新):自动刷新并指向新页面。

用法:

<meta http-equiv="Refresh" content="2;URL">;(注意后面的引号,分别在秒数的前面和网址的后面)

注意:其中的2是指停留2秒钟后自动刷新到URL网址。

 

还有其他属性,以后碰到再往里面加。
 
body:里面放各种DIV和HTML标签。
0 0