标签:
label与表单相对应,当点击相应的label文字时,for属性指向的id元素会获得焦点,将input放入label中也可以得到同样的效果
路径分为绝对路径和相对路径,最好使用相对路径,image/panda.jpg,默认当前文件所在路径,./image/一个.代表当前目录下,../代表当前目录的上一层
提交表单,input中一定要写name属性
------------------------------------------------------------------------------------------------------------------------------------------------
HTML标签学习
有序列表ol
<ol>
<li>A</li>
<li>B</li>
</ol>
属性type为A|a|i|I|数字 start=开始的数字
---------------------------------------------------------------------------------------------------
代码:
<form id="form1" enctype="" action="" method="">
<table align="center" border="1" >
<caption>表单</caption>
<thead>
<tr>
<td><label for="username">用户名:</label></td>
<td><input type="text" id="username" name="username" /></td>
</tr>
<tr>
<td><label for="pwd">密码:</label></td>
<td><input type="password" id="pwd" name="pwd" /></td>
</tr>
<tr>
<td><label for="gender">性别:</label></td>
<td><select name="gender" id="gender">
<option value="男">男</option>
<option value="女">女</option>
</select></td>
</tr>
<tr>
<td>你喜欢的运动:</td>
<td>
<p>
<input type="checkbox" name="checkGroupHealthy" id="checkGroupHealthy_0" value="篮球">
<label for="checkGroupHealthy_0">篮球</label>
<br/>
<input type="checkbox" name="checkGroupHealthy" id="checkGroupHealthy_1" value="足球">
<label for="checkGroupHealthy_1">足球</label>
</p>
</td>
</tr>
<tr>
<td rowspan="2">你爱吃的菜:</td>
<td>
<label>
<input type="radio" name="radioGroupFood" id="radioGroupFood_0" value="烤鱼" />烤鱼
</label>
</td>
</tr>
<tr>
<td>
<label>
<input type="radio" name="radioGroupFood" id="radioGroupFood_1" value="土豆粉">土豆粉
</label>
</td>
</tr>
<tr>
<td><label for="textarea">我的简介:</label></td>
<td>
<textarea id="textarea" name="textarea" rows="10" cols="20"></textarea>
</td>
</tr>
<tr>
<td><label for="file">上传头像</label></td>
<td>
<input type="file" id="file" name="file"/>
</td>
</tr>
<tr>
<td>
<input type="submit" value="提交">
</td>
<td>
<input type="reset" value="重置">
</td>
</tr>
<tr>
<td>分组</td>
<td>
<fieldset>
<legend>篮球小组</legend>
<ul>
<li>姚明</li>
<li>易建联</li>
</ul>
</fieldset>
<fieldset>
<legend>足球小组</legend>
<ol>
<li>C罗</li>
<li>梅西</li>
</ol>
</fieldset>
</td>
</tr>
<tr>
<td>隐藏的标记</td>
<td>
<input type="hidden" value="qqq">
</td>
</tr>
<tr>
<td>图片按钮</td>
<td>
<input type="image" id="imagebutton" name="imagebutton" src="C:\Users\Administrator\Desktop\Icey\Web前端\Week1\Photo\favicon.ico">
</td>
</tr>
</thead>
</table>
</form>
标签:
原文地址:http://www.cnblogs.com/IceyB/p/5631788.html