有序列表ol的属性:type设置项目符号,默认值为1可取值a A 罗马数字
start:设置从第几个开始取值为数字
reversed倒序 reversed=”reversed”
表格的标签:<table></table>表格
<tr></tr>行 <td></td> 列、单元格 <th></th>特殊的单元格,默认水平居中且加粗,和td一个位置。 <caption></caption>表格的标题
结构例子:table>tr*3——tab(简单生成方法)三行三列
表格属性:border:设置表格的边框,表格默认没有边框
align:设置表格的对齐方式,默认居中
width;表格宽度
height:表格高度
Bgcolor:设置表格背景颜色
Background:设置表格的背景图片,背景图片比背景颜色的优先级高
cellpadding;设置内容边框的距离
Cellspacing:设置单元格间的距离,当取值为0,单元格间没有距离,变为一条线。
tr的属性:height设置一行的行高 width:宽度
align:设置行内容的水平对齐方式,默认值left,取值center,right
valign:设置行内容的垂直对齐方式,默认middle居中,取值top居上,bottom居下
bgcolor这行背景颜色 background:该行背景图片
td的属性和tr一样
单元格合并:colspan水平合并
写在开始合并的单元格内,取值为数字,删除的个数=取值的个数-1,水平合并并删除同一行的td
rowspan:垂直合并
写在开始合并的单元格内,取值为数字,删除的个数=取值的个数-1,水平合并并删除同一行的td
表单的作用:表格向用户显示数据,表单可以提交数据到服务器,使页面具有交互性
标签:<form></form>双标记块级元素(form之间不能相互嵌套)
form的属性:<form name=”表单的名称” action=”提交的地址” method=”提交的方式”get/post”> </form>
get与post的区别:get为默认值
get提交的数据不安全,会在地址栏中显示,post安全,get智能体较少量的数据不能大于2kb,post理论上没有限制。
表单元素:一个完整的表单包含表单标签<from></from>,
表单域用input标签定义包含不同类型比如文本域、下拉表单、单选框、复选框,
表单按钮:用来提交<from>表单中的所有信息到服务器。
Input:输入 type:类型 text:文本 userName: 用户名 value:当前值
password:密码 radio:单选按钮、单选框 checkbox:多选按钮、多选框
例如:
<form action=”” name=”foema”>
用户名:<input type=”text” name=”userName” value=”请输入用户名”/><br/>
密码:<input type=”password” name=”password” value=”密码”/><br/>
性别:<input type=”radio” name=”sex”/>男
<input type=”radio” name=”sex”/>女
<input type=”radio” name=”sex”/>人妖</br>
爱好:
<input type=”checkbox” />篮球
<input type=”checkbox” />游泳
<input type=”checkbox” />游戏
<input type=”checkbox” />拍球
</form>
提交按钮:<input type=”submit”/>
重置按钮:<input type=”reset”/>
没有任何功能的一个按钮:<input type=”button”/>
提交按钮:<button></button>more默认值type=”submit”
重置按钮:<button type=”reset”></button>
没有任何功能的按钮<button type=”button”></button>
例:<input type=”submit” value=”登录”/>
<input type=”reset” value=”取消”/>
<input type=”button” value”没有任何功能的按钮”/>
<button>提交 默认值类型为submit</button>
<button type=”reset”>重置</button>
<button type=”button”>没有任何功能的按钮</button>
下拉表单:
<select>
<option></option>
<option></option>
<option></option>
</select>
多行文本域:<textarea cols=”每行中的字符数” rows=”显示的行数”+></textarea>
label标签;当点击label之间的内容,相关的标签会被选中
<label for=””></label>
label的for属性和表单属性的id属性一致
例如:
爱好;
<input type=”checkbox” id=”basketball/>
<label for=”basketball”>篮球</label>
表单元素:
文件<input type=”file”/> 当表单元素有文件时,需要把表单的编码格式改为二进制,enctype=”multipart/form-data”
隐藏域:<input type=”hidden”/>,隐藏用户自己看不到,但携带的信息可以正常提交
图片按钮:<input type=”inage” src=”路径”/>
disabled:禁用 <input type=”text” disabled/>
readonly:只读<input type=”paassword” readonly/>
新增的HTML5元素(属性):
邮箱:<input type=”emil”/>必须包含@,@后面必须有内容。
网址:<input type=”url”/>必须包含一个协议,协议后面必须有内容。
搜索:<input type=”search”/>
颜色:<input type=”color”/>
数字:<inpuy type=”nmber”/>
范围:<input type=”range”/>
电话:<input type=”tel”/>
日期:<input type=”date”/>
周:<input type=”week”/>
月:<input type=”month”/>
Placekolder=”” 默认提示:
例如:<ijnput type=”text” placekolder=”手机/邮箱/用户名”/>
autofocus 自定获取焦点,推荐写在第一个表单元素上面
required 必须要填不能为空、
ming和max 最大值和最小值,配合数字和范围使用
minlength 和maxlength 最小长度和最大长度
step:步长,配合数字和范围使用,可以去任意值
multiple :可以输入多个,用英文的逗号隔开,配合邮箱和网址使用
例如:<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form action="text" name="forml">
<p>
姓名:<input type="text" name="userName" placheholder="请输入你的用户名" autofocus required minlength="2" maxlength="6"/>
</p>
<p>
密码:<input type="password" name="password" required />
</p>
<p>
邮箱:<input type="email" name="email" />
</p>
<p>
数字:<input type="number" min="0" max="100" step="5"
</p>
<p>
<input type="submit"/>
<input type="reset"/>
</p>
</form>
</body>
</html>