html第三节课

表单

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>表单</title>
</head>

 

<body>
<img src="../study/简历/35262352[1].jpg" usemap="map" />
<map name="map">
<area shape="circle" coords="279,126,50" href="http://www.baidu.com/" />
<area shape="rect" coords="81,179,209,257" href="http//360.com/" />
</map><br />
<div style="height:300px; 400px; border:1px #900 solid">
<iframe width="600px" src="../study/简历/柏成嵩简历.html" frameborder="1"></iframe>
</div>
</body>
</html>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<form>
文本框:<input type="text" value="123" disabled="disabled" /><br />
密码框:<input type="password"/><br />
文本域:<textarea cols="35" rows="5"/>


</textarea><br />
<input type="submit" value="提交"/><br />
<input type="reset" value="重置"/><br />
<input type="button" value="登录"/><br />
<input type="image" src="../study/简历/40383852[1].jpg" width="50"/>
<input type="radio" name="sex" /><label>男</label><br />
<input type="radio" name="sex" />女<br />
<input type="checkbox" checked="checked" disabled="disabled" />鸡腿<br />
<input type="checkbox" />可乐<br />
<input type="checkbox" />爆米花<br />
<input type="file" /><br />
<select size="1">
<option>可口可乐</option>
<option>百事可乐</option>
<option selected="selected">崂山可乐</option>
</select>
</form>
</body>
</html>

1.3.2、表单

  <form id="" name="" method="post/get" action="负责处理的服务端"> id不可重复;name可重复;get提交有长度限制,并且编码后的内容在地址栏可见,post提交无长度限制,且编码后内容不可见。

</form>

1、文本输入

  文本框<input type="txt" name="" id="" value="" />

  密码框<input type="password" name="" id="" value="" />

  文本域<textarea name="" id="" cols=""(字符多少) rows=""(几行高)></textarea>

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

2、按钮

  提交按钮<input type="submit" name="" id="" disabled="disabled" value=""/>点击后转到form内的提交服务器的地址

  重置按钮<input type="reset" name="" id="" disabled="disabled" value=""/>

  普通按钮<input type="button" name="" id="" disabled="disabled" value=""/>

图片按钮<input type="image" name="" id="" disabled="disabled" src="图片地址"/>

 

附:

disabled,使按钮失效;enable,使可用。

 

3、选择输入

  单选按钮组<input type="redio" name="" checked="checked" value=""/>   name的值用来分组;value值看不见,是提交给程序用的;checked,设置默认选项。

复选框组<input type="checkbox" name="" checked="checked" value=""/>

  文件上传<input type="file" name="" id="" />

<lable for=""></lable>

<label> 标签为 input 元素定义标注(标记)。

label 元素不会向用户呈现任何特殊效果。不过,它为鼠标用户改进了可用性。如果您在 label 元素内点击文本,就会触发此控件。就是说,当用户选择该标签时,浏览器就会自动将焦点转到和标签相关的表单控件上。

<label> 标签的 for 属性应当与相关元素的 id 属性相同。

 

下拉列表框

  <select  name="" id="" size="" multiple="multiple">    --size=1时,为菜单;>1时,为列表。multiple为多选。

   <option value="值">内容1</option>

<option value="值" selected="selected">内容2</option>    --selected,设为默认

<option value="值">内容3</option>

  </select>

 

原文地址:https://www.cnblogs.com/xiongxiaobai/p/5297595.html