前端开发之html基础知识02

经典表格:表格没有列的概念,只有行的概念, 一行 tr,行中的单元格 td
表头的突出显示:tr>th

<table width="400px" align="center" border="1px" cellspacing="0"
cellpadding="5px"
> <!-- align = "center" 表格整体剧中-->
<caption>个人信息表</caption>
<thead>
<tr align="center">
<td>姓名</td>
<td>性别</td>
<td>电话</td>
</tr>
</thead>
<tbody>
<tr align="center">
<td>小明</td>
<td>男</td>
<td>187</td>
</tr>
<tr align="center">
<td>小红</td>
<td>女</td>
<td>157</td>
</tr>
</tbody>
</table>

表格其他设置:单元边框和表格边框的距离-> cellspacing 0

合并单元格:
跨行 rowspan
跨列 colspan

表单控件

<label for="i1">用户名<input type="text" id = i1></label>
label 标签用于点击标签即可跳转到输入框,提高用户体验

文本域,不支持富文本:<textarea name="" id="" cols="3" rows="5" ></textarea>

下拉菜单:select>option
<select name="" id="">
<option value="">1992</option>
<option value="">1993</option>
<option value="">1994</option>
<option value="">1995</option>
</select>

input属性: 提示: checked = "checked" 为单选默认选中状态 maxlength = 6

text
password

radio 单选 需要在每个选项中 name的值保持一致
<label for=""><input type="radio" name="gender">男</label>
<label for=""><input type="radio" name = "gender">女</label>

checkbox 多选
<label for=""><input type="checkbox" name = “like1”>篮球</label>
<label for=""><input type="checkbox" name = “like2”>足球</label>
<label for=""><input type="checkbox" name = “like2”>排球</label>

btton 按钮
submit 提交
reset 重置
image
file

form 表单:
<form action="http://baidu.com" method="get" name = "mydata">

猜你喜欢

转载自www.cnblogs.com/huasongweb/p/9589897.html
今日推荐