Div+css首页

HTML规范

一、 HTML 头:

1、针对日文环境:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01Transitional//EN">
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>yourtitle</title>
</head>

2、针对中文环境:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01Transitional//EN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>yourtitle</title>
</head>

二、html中javascript的书写:

<head>…..
<script type="text/javascript">
<!—…..-->
</script>
</head>


三、html中元素的书写:

1、 元素属性值必须包含在双引号中;

<font color=”#000000” size=”3” face=”Arial”>

2、 form 中必须加action属性,并且不能为空。

<form action=”/r/add.cgi” method=”post”>

如果不需要使用action属性,也必须定义:

<form action=”no” >

3、 img的alt属性不可以缺少;

<img src="/q/img/btn_style.gif" border="0" alt="Select”>

4、 head与</head>之间必须有title;

<head>

……

<title>your title </title>

……

</head>

5、 tr、td必须定义在table之间;

<table>

<tr>

<td>……</td>

….

</tr>

</table>

6、 button按钮必须定义在form之间,否则netscape不支持;

<form action=”……” method=”post”>

<input type=”button” name=”but” value=”back”>

</form>

7、 在javascript中的字符串中出现的“/”前要用转义符“\”:

<script type=”text/javascript”>

<!—

function check(str) {

var str=”\/r\/add.cgi”;

……

}

-->

</script>

8、 onclick 属性必须和 onkeypress 成对写( onmousedown + onkeydown、onmouseup + onkeyup)

<a href=”javascript:void[0]” onClick=”javascript:wopen(….);return false” onkeypress=”javascript:wopen(…);return false”>mm</a>

9、 用URL传值时直接写&是不可以的,可用&替换:

<a href=”/r/add.cgi?uid=sqz&sid=1&pid=1”></a>

四、缩近规则:

<table>中<td></td>,<tr></tr>等必须保持严格的缩近规则,以"Tab"键为准:

<table>

<tr>

<td>

<table>

<tr>

<td>…</td>

</tr>

</table>

</td>

….

</tr>

</table>

五、只有根据以上规则书写,并经过以下软件http://divhome.com (日文)检查。检查结果中,错误级别必须小于或者等于3级,总分超过80分的HTML才能提交给用户" 
 

Div之家