html難點標(biāo)簽
iframe 標(biāo)簽
現(xiàn)在已經(jīng)不常用,用起來會很卡。因為相當(dāng)于新開一個窗口。
<iframe name=xxx width="100%" height="500px" frameborder="3"></iframe>
<a target=xxx >weibo</a>
<a target=xxx >sina</a>
iframe的name屬性和a的target屬性相關(guān)聯(lián)。
a標(biāo)簽
跳轉(zhuǎn)頁面(HTTP GET 請求)
- target
- _blank 在新頁面打開
- _self 在當(dāng)前頁面打開
- _parent iframe父元素打開
- _top iframe嵌套三層以上,最頂層打開
- download屬性
- 只對同源鏈接有效
- http content-type:application/octet-stream
- href
- 不可以寫
qq.com,會被當(dāng)成文件 - 可以寫
//qq.com,會自動匹配當(dāng)前協(xié)議,files或者http等 -
./xxx.html發(fā)起http請求,get ./xxx.html文件 -
#dfgjkdfgj不發(fā)http請求,只有錨點不發(fā)起請求 -
?name=cuilei發(fā)起http請求 -
javascript: alert(1)-
javascript: ;點擊之后什么都不做 - 偽協(xié)議,歷史遺留問題??梢宰龅讲话l(fā)請求,頁面不動
-
-
空白也會發(fā)出http請求,刷新頁面 - ``沒有任何內(nèi)容也會發(fā)出http請求,刷新頁面
- 不可以寫
form 標(biāo)簽
跳轉(zhuǎn)頁面(HTTP POST 請求)
里面必須要有submit按鈕。
有name屬性的才能提交到data。
data中的顯示,為html屬性name:value
默認(rèn)為get,只有g(shù)et和post。
target屬性使用和a標(biāo)簽一樣。
<form action="users" method="post">
<input type="text" name="username">
<input type="password" name="password">
<input type="submit" value="提交">
</form>
post
post把參數(shù)放到 第四部分里面
action可以修改為查詢參數(shù)。

method為post時,發(fā)出的http請求
get
get把參數(shù)放到查詢參數(shù)里面

method為get時,發(fā)出的http請求
input / button
- slider
- search
- range
- controls
type
-
button
button和submit的區(qū)別:
如果form中只有一個
<button>button</button>,那么button標(biāo)簽會自動升級為submit提交按鈕。submit是唯一能確定form能不能提交的按鈕。如果type是button,只是普通按鈕。
-
checkbox多選
- 被選中
value默認(rèn)為on
- 被選中
-
radio單選
- 相同的name屬性只有一個會被選中。
<input type="checkbox" id="xxx"> <label for="xxx">吃飯</label>
id=for時,點擊文字,checkbox也會反應(yīng)。
把label包住input可以省略
id和for
label功能使文字和input相關(guān)聯(lián)。
select
textarea
<textarea style="resize: none; width: 100px; height: 100px;" name="" id="" cols="30" rows="10"></textarea>
table
trtable roll
tdtable data
thtable header
css中添加border-collapse: collapse;,表格變成單線。
<table border=1>
<colgroup>
<col width=100>
<col width=200>
<col width=100>
<col width=70>
</colgroup>
<thead>
<tr>
<th></th>
<th>姓名</th>
<th>班級</th>
<th>分?jǐn)?shù)</th>
</tr>
</thead>
<tbody>
<tr>
<th>平均分</th>
<td>小明</td>
<td>2</td>
<td>3</td>
</tr>
</tbody>
<tfoot>
<tr>
<th>總分</th>
<td>小紅</td>
<td>2</td>
<td>3</td>
</tr>
</tfoot>
</table>