html总结概要

来源:互联网 发布:python 2.7.11 编辑:程序博客网 时间:2024/05/16 05:41

<!DOCUMENT>标签

位于<html>标签之前,告知浏览器使用的HTMLXHTML规范。

该标签可声明三种 DTD 类型,分别表示严格版本、过渡版本以及基于框架的 HTML/XHTML 文档:StrictTransitional 以及 Frameset

<!DOCTYPE html

PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

第一行:声明文档根元素为html

第二行:定义公共标示符,浏览器将明白如何寻找匹配此公共标识符的 DTD

第三行:如果找不到,浏览器将使用公共标识符后面的 URL 作为寻找 DTD 的位置。

W3C的网页验证:

html/xhtmlhttp://validator.w3.org/ 

csshttp://jigsaw.w3.org/css-validator/ 

<head>标签

<title></title>      浏览器窗口的标题栏里的网站名/网站说明

<meta />          元信息

<link />           链接,一般是css链接

<style></style>     网页内部css

<script></scritpt>   网页内部javascript

<meta />:

meta就是“关于”(about)的意思。在HTML里,meta标记(meta tags)表示用来描述网页的有关信息。如:关键字、作者、描述、网页过渡时间等多种信息。

http-equiv:     http请求

name:           属性名

content:         属性值   

网页编码:

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

关键字:

<meta name="keywords" content="关键字1,关键字2,关键字3" />

网页描述:

<meta name="description" content="关于网页信息的描述" /> 

自动刷新:
<meta http-equiv="refresh" content="5" />

自动跳转:

<meta http-equiv="refresh" content="5; url=www.baidu.com" />

样式:

<link rel="stylesheet" href="mainstyles.css" type="text/css">

<style>... ....</style>

javascript

<script type="test/javascript" src="......." />

<script>........</scritpt>

HTTP状态消息(常见)

1xx: 信息

100 Continue   

101 Switching Protocols

2xx: 成功

200 OK

201 Created

202 Accepted

3xx: 重定向

301 Moved Permanently    永久移动

307 Temporary Redirect    临时移动

4xx: 客户端错误

400 Bad Request          坏请求

403 Forbidden            禁止访问

404 Not Found           未找到页面

408 Request Timeout      请求超时

5xx: 服务器错误

500 Internal Server Error    请求未完成,内部错误

502 Bad Gateway          坏网关

html常用标签

常用实体:   <  >  &  "

链接:<a href="http://www.baidu.com" target="_black/_self">百度</a>

图片:<img scr="http://www.baidu.com/images/a.png" />

框架:

<frameset rows="50%,50%">

<frame src='aaa.html'>

<frameset cols='25%,75%'>

    <frame src='bbb.html' noresize='noresize'>

    <frame src='ccc.html'>

</frameset>

</frameset>

表格:

<table boder="1">

    <tr>

        <th>姓名</th>

        <td>bill gates</td>

    </tr>

    <tr>

        <th rowspan="2">电话</th>

        <td>000000</td>

        <td>111111</td>

    </tr>

</table>

列表:

ul ol li

无序列表  ul 原点标记  type="xxx" disc:实心点 circle:空心点 square:方形点

有序刘表  ol 数字标记  type="xxx" 默认:123    A:ABC         a:abc

取消标记  list-style:none

表单:

<form name="form" action="action.php" methord="post">

    <input type="text" name="text" />  //文本域 Text fields

    <input type="password" name="password" />  //密码域

    男<input type="checkbox" name="man" />  //复选框

    女<input type="checkbox" name="woman" />

    <input type="radio" name="sex" value="male" checked="checked" />male  //单选按钮

    <input type="radio" name="sex" value="female" />female

    <select name="country">

        <option value="china" selected="selected">china</option>  //下拉框

        <option value="usa">usa</option>

    </select>

    <textarea rows="10" cols="30"/>  //多行文本域

<input type="hidden" value="" />  //隐藏域

    <input type="submit" value="submit">  //提交按钮

</form>