网站首页head区代码规范

HTML CSS 2016-12-02

head区是指首页HTML代码的<head>和</head>之间的内容。 

必须加入的标签 

    1.公司版权注释 

<!--- The site is designed by Maketown,Inc 06/2000 ---> 

    2.网页显示字符集 

简体中文:<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"> 

繁体中文:<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=BIG5"> 

英 语:<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> 

    3.网页制作者信息 

<META name="author" content="webmaster@maketown.com"> 

    4.网站简介 

<META name="DEs criptION" CONTENT="xxxxxxxxxxxxxxxxxxxxxxxxxx"> 

    5.搜索关键字 

<META name="keywords" CONTENT="xxxx,xxxx,xxx,xxxxx,xxxx,"> 

    6.网页的css规范 

<LINK href="style/style.css" rel="stylesheet" type="text/css"> 

(参见目录及命名规范) 

    7.网页标题 

<title>xxxxxxxxxxxxxxxxxx</title> 

.可以选择加入的标签 

1.设定网页的到期时间。一旦网页过期,必须到服务器上重新调阅。 

<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT"> 

2.禁止浏览器从本地机的缓存中调阅页面内容。 

<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 

3.用来防止别人在框架里调用你的页面。 

<META HTTP-EQUIV="Window-target" CONTENT="_top"> 

4.自动跳转。 

<META HTTP-EQUIV="Refresh" CONTENT="5;URL=http://www.yahoo.com"> 

5指时间停留5秒。 

5.网页搜索机器人向导.用来告诉搜索机器人哪些页面需要索引,哪些页面不需要索引。 

<META name="robots" CONTENT="none"> 

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

6.收藏夹图标 

<link rel = "Shortcut Icon" href="favicon.ico"> 

所有的javas cript的调用尽量采取外部调用. 

<s cript LANGUAGE="Javas cript" src="s cript/xxxxx.js"></s cript> 

附<body>标签: 

<body>标签不属于head区,这里强调一下,为了保证浏览器的兼容性,必须设置页面背景<body bgcolor="#FFFFFF"> 

相关推荐