1.最重要的三个标签(但都可以省略):
<html><head><body>
不过<title></title>不能省略
2.<a>(a标签和form标签都是用来发送请求的,a表爱你是get请求,form标签是post请求)
<a href="http://qq.com" target="_blank">QQ</a>
<a href="http://qq.com" target="_self">QQ</a>
<a href="http://qq.com" target="_parent">QQ</a>
<a href="http://qq.com" target="_top">QQ</a>
<a href='url' download="filename.ext">下载</a> (download)
href支持:
(1)无协议 //qq.com
(2)?nameea
(3)想要a标签但不跳转(什么都不做):javascript伪协议<a href="javascript:;">QQ</a>
3 <form>标签:
用于发送POST请求。
1.如果form没有提交按钮就无法提交form
input有很多type:
input 的属性见:https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/Input
button 的属性见:https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/button
如果一个form只有一个按钮(没有type),会自动升级为提交按钮:
<form action="users" method="POST">
<button>button</button>
<label for="aaa">用户名</label> <input type="text" name="username" id="aaa">
<label><input type="password" name="password" id="">密码</label>
喜欢的水果
<label><input type="checkbox" name="fruit" id="" value="orange">橘子</label>
<label><input type="checkbox" name="fruit" id="" value="banana">香蕉</label>爱我
<input type="radio" name="love" id="" value="yes">爱我
<input type="radio" name="love" id="" value="no">不爱
<select name="group" id="" multiple>
<option value="">-</option>
<option value="1">第一组</option>
<option value="2">第二组</option>
<option value="3" disabled>第三组</option>
<option value="4" selected>第四组</option>
</select>
<textarea name="habit" style="resize:none; width:100px; height:50px;"></textarea>
<input type="submit" value="提交">
</form>
4. <table>标签
<style>
table{
border-collapse:collapse;
}
</style>
<table border=1>
<colgroup>
<col width=100>
<col width=200>
<col width=90>
</colgroup>
<thead>
<tr>
<th>项目</th>
<th>姓名</th>
<th>班级</th>
<th>分数</th>
</tr>
</thead>
<tbody>
<tr>
<th></th><td>小红</td><td>1</td><td>96</td>
</tr>
<tr>
<th></th><td>小明</td><td>2</td><td>95</td>
</tr>
<tr>
<th>平均分</th>
<td></td>
<td></td>
<td>95</td>
</tr>
</tbody>
<tfoot>
<tr>
<th>总分</th>
<td></td>
<td></td>
<td>190</td>
</tr>
</tfoot>
</table>