基本结构:
<!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title></title> </head> <body> </body> </html>
2.文档类型:
(1)html 4.01
<!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd">
(2)html5
<!doctype html>
(3)xhtml 1.0
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
3.头部:
(1)字符集
<meta http-equiv="content-type" content="text/html; charset=utf-8">
(2)引入js
<script language="javascript"></script> <script language="javascript" src=""></script> <script language="javascript">var u="__url__";var a="__app__";</script> <script language="javascript" src="__public__/js/jquery-1.8.1.min.js"></script>
(3)引入css
复制代码
代码如下:
<style type="text/css"></style> <link rel="stylesheet" href="" type="text/css">
(4)设置默认跳转
<base href="" /> <base target="_blank" />
(5)设置搜索引擎相关信息
<meta name="description" content=",," /> <meta name="keywords" content=",," />
4.主体:
(1)基本内容
<body onload=""> <div id="" class=""> </div> <div style="clear:both;">
(2)表单
get方式提交:
<form id="" action="" method="post"></form>
post方式提交:
<form id="" action="" method="get"></form>
携带文件提交:
<form id="" action="" method="post" enctype="multipart/form-data"></form>
首页常用:
文本域:<input id="" name="" class="" type="text"></input> 密码域:<input id="" name="" class="" type="password"></input> 普通按钮:<input id="" name="" class="" type="button"></input> 单选按钮:<input id="" name="" class="" type="radio"></input> 多选按钮:<input id="" name="" class="" type="checkbox"></input>
相信看了这些案例你已经掌握了方法,更多精彩请关注其它相关文章!
相关阅读:
怎样通过disabled和readonly将input设置为只读效果
meta的标签有哪些作用
html的头标签meta如何实现refresh重新定向
html的form内部标签应该如何使用
以上就是常用html元素结构有哪些的详细内容。
