欢迎光临
我们一直在努力

Web设计中关于首页代码一些规范写法

建站超值云服务器,限时71元/月

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

head区必须加入的标识

公司版权注释 <!— The site is designed by yourcompany,Inc 03/2001 —>

网页显示字符集 例如:
简体中文:<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">

原始制作者信息 <META name="author" content="webmaster@yoursite.com">

网站简介 <META NAME="DESCRIPTION" CONTENT="这里填您网站的简介">

搜索关键字 <META NAME="keywords" CONTENT="关键字1,关键字2,关键字3,…">

网页的css规范 <LINK href="style/style.css" rel="stylesheet" type="text/css">

网页标题 <title>这里是你的网页标题</title>

head区可以选择加入的标识

设定网页的到期时间。一旦网页过期,必须到服务器上重新调阅。
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">

禁止浏览器从本地机的缓存中调阅页面内容。
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">

用来防止别人在框架里调用你的页面。
<META HTTP-EQUIV="Window-target" CONTENT="_top">

自动跳转。
<META HTTP-EQUIV="Refresh" CONTENT="5;URL=http://www.yahoo.com">
5指时间停留5秒。

网页搜索机器人向导.用来告诉搜索机器人哪些页面需要索引,哪些页面不需要索引。
<META NAME="robots" CONTENT="none">
CONTENT的参数有all,none,index,noindex,follow,nofollow。默认是all。

收藏夹图标
<link rel = "Shortcut Icon" href="favicon.ico">

JS调用规范

所有的javascript脚本尽量采取外部调用
<SCRIPT LANGUAGE="javascript" SRC="script/xxxxx.js"></SCRIPT>

CSS书写规范

所有的CSS的尽量采用外部调用
<LINK href="style/style.css" rel="stylesheet" type="text/css">

书写时重定义的最先,伪类其次,自定义最后(其中a:link a:visited a:hover a:actived 要按照顺序写)便于自己和他人阅读。

为了保证不同浏览器上字号保持一致,字号建议用点数pt和像素px来定义,pt一般使用中文宋体的9pt和11pt,px一般使用中文宋体12px 和14.7px 这是经过优化的字号,黑体字或者宋体字加粗时,一般选用11pt和14.7px 的字号比较合适。

CSS推荐模板。

<style type="text/css">
<!—
p { text-indent: 2em; }
body  { font-family: "宋体"; font-size: 9pt; color: #000000; margin-top: 0px;  margin-right: 0px; margin-bottom: 0px; margin-left: 0px}
table { font-family: "宋体"; font-size: 9pt; line-height: 20px; color: #000000}
a:link { font-size: 9pt; color: #0000FF; text-decoration: none}
a:visited { font-size: 9pt; color: #990099; text-decoration: none}
a:hover { font-size: 9pt; color: #FF9900; text-decoration: none}
a:active { font-size: 9pt; color: #FF9900; text-decoration: none}
a.1:link { font-size: 9pt; color: #3366cc; text-decoration: none}
a.1:visited { font-size: 9pt; color: #3366cc; text-decoration: none}
a.1:hover { font-size: 9pt; color: #FF9900; text-decoration: none}
a.1:active { font-size: 9pt; color: #FF9900; text-decoration: none}
.blue { font-family: "宋体"; font-size: 10.5pt; line-height: 20px; color: #0099FF; letter-spacing: 5em}
–>
</style>

body标识

为了保证浏览器的兼容性,必须设置页面背景<body bgcolor="#FFFFFF">

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » Web设计中关于首页代码一些规范写法
分享到: 更多 (0)