1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 表格 表单 文本域 下拉框 单选框 复选框 按钮

表格 表单 文本域 下拉框 单选框 复选框 按钮

时间:2020-10-31 19:28:51

相关推荐

表格 表单 文本域 下拉框 单选框 复选框 按钮

1.表格基本结构

<table border="" cellspacing="" cellpadding=""><tr><th>表格标题</th><td>单元格</td>....</tr>...</table>

1,表格

1, border:边框粗细

cellspacing:代表格与格之间的间距

cellpadding:代表内容距离格子四条边的距离

width/height:宽高

bgcolor:背景颜色

align:相对于浏览器的居中方式

left/center/right

2,合并单元格

colspan 水平合并单元格

rowspan 垂直合并单元格

2,表单

form标签是用来表示采集数据的范围

1. <form action="" method=""></form>

属性:1.action 采集的数据提交的路径

2.method 采集的数据提交的方式

值:1)get 2)post

2. <input type="" name="" value="" placeholder="">input 输入

属性:1.type 类型type="text" 文本框type="password" 密码框type="radio" 单选框 name值必须保持一致type="checkbox" 复选框type="submit"提交按钮type="reset"重置按钮type="button" 普通按钮type="file" 文件上传按钮2.name 名字 给标签起的名字3.value 值 输入的值4.placeholder 输入域的提醒文本

3.单选框 与 复选框

默认被选中 checked 或 checked="checked"

例如:<input type="checkbox" name="apple" checked>苹果

点击文字能把单选框或复选框选中:

1)用label双标记标签把单选框/复选框与文字一起包起来

例如: <label><input type="checkbox" name="apple">苹果</label>

2)用label标签只包裹文字,label上的for的值与单选框/复选框上的id的值保持一致

例如: <input type="radio" name="gender" id="male"><label for="male">男性</label>

4.文本域

<textarea placeholder="提醒文本"></textarea>

5.下拉选择框

<select><option>选项1</option><option selected>选项2</option>....</select>

选项默认被选中,给option增加selected或selected="selected"

6.按钮

块元素:12

p,h1,h2,h3,h4,h5,h6,ul,ol,div,hr,form

行内元素(内联元素)9

b,strong,i,em,sup,sub,span,a,label

行内块元素(内联块元素)6

img,iframe,input,textarea,select,button

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。