基本结构:
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=UTF-8">
<title></title>
</head>
<body>
</body>
</html>
2.文档类型:
(1)HTML4.01
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
(2)HTML5
<!DOCTYPEhtml>
(3)XHTML1.0
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3.头部:
(1)字符集
<metahttp-equiv="Content-Type"content="text/html;charset=UTF-8">
(2)引入JS
<scriptlanguage="javascript"></script>
<scriptlanguage="javascript"src=""></script>
<scriptlanguage="javascript">varu="__URL__";vara="__APP__";</script>
<scriptlanguage="javascript"src="__PUBLIC__/js/jquery-1.8.1.min.js"></script>
(3)引入CSS
复制代码
代码如下:
<styletype="text/css"></style>
<linkrel="stylesheet"href=""type="text/css">
(4)设置默认跳转
<basehref=""/>
<basetarget="_blank"/>
(5)设置搜索引擎相关信息
<metaname="description"content=",,"/>
<metaname="keywords"content=",,"/>
4.主体:
(1)基本内容
<bodyonload="">
<divid=""class="">
</div><divstyle="clear:both;">
(2)表单
GET方式提交:
<formid=""action=""method="post"></form>
POST方式提交:
<formid=""action=""method="get"></form>
携带文件提交:
<formid=""action=""method="post"enctype="multipart/form-data"></form>
首页常用:
文本域:<inputid=""name=""class=""type="text"></input>
密码域:<inputid=""name=""class=""type="password"></input>
普通按钮:<inputid=""name=""class=""type="button"></input>
单选按钮:<inputid=""name=""class=""type="radio"></input>
多选按钮:<inputid=""name=""class=""type="checkbox"></input>
本文转载自中文网 |