HTML小结

HTML总结

一、表单 form

1.name 表单名称

2.action 提交的位置

3.method 传送方式 post 和 get

      1)get是指在url后面加上传送字符串,传送内容会出现在浏览器地址栏上,会有安全问题,并且传送的资料量不可太大

      2)post是指传送信息作为http请求的一部分,但是不会显示在浏览器地址栏,可以传送大量的数据

4.enctype 指定在发送到服务器之前应该如何对表单数据进行编码

     1)application/x-www-form-urlencoded:(默认值)规定将空格键转换为+,将特殊字符转化为ASC码

     2)multipart/form-data:不对表单数据进行转化

     3)text/plain :只是讲空格转化为+,不对特殊字符进行转换

 

二、表单元素

1.所有的表单元素必须要写上name属性,否则不会提交到服务器

2.文本框

   <input type="text" name="d1" value="" /> value是设置默认值

3.密码框

   <input type="password" name="d1" value="" />

4.下拉列表:一个点要注意,如果option中value没有指定,被选中提交的时候会提交文本值

  <select name="d7">

         <option value="0">请选择</option>

   </select>

5.复选框

   <input type="checkbox" name="d8" value="" size="30%">显示高级用户设置选项</input>

  name相同即为同一组,如果value不写值默认提交on,而不是空字符串

6.单选框

<input type="radio"  name="d11" checked />男,注意实现同复选框一样

 

三、框架

1、<frameset>标签

cols=“20%,200,*”:以列方式分割,上半部占20%,中间部分200pixel,剩下为第三部分。

rows=“20%,200,*”,以行方式分割

border=“1”:框线宽度pixel

frameborder=“yes”:是否显示框线,no不显示框线

scrolling=“NO”:不会有scrolling bar,默认为yes

Noresize : 使用者无法调整分割网页的大小。

 2、框架集的嵌套

 

<frameset rows="10%,*" frameborder="1" >
	<frame src="top.html"/>
	 <frameset cols="20%,*">
     	<frame src="left.html" scrolling="no" noresize="noresize"/>
        <frame src="right.html" name="content"/>
     </frameset>
    	 
</frameset>
 

 

 3、超链接

1)、target属性

_blank :打开一个新窗口

_top :链接会开启在原本窗口中,并占满整个浏览器窗口

_parent:占满目前子网页的frameset所指定区域

_self 本框架集里面打开

2)、定义一个锚点并跳转到盖帽点

<a name="label">Text to be displayed</a>

<a href="http://www.w3schools.com/html_links.asp#label">Jump to the label</a>

3)、相对路径

<a href=“a.html”/> 本文件所在目录下的a.html

<a href=“../a.html”/>上层目录下的a.html