iframe標簽
表示嵌套的瀏覽上下文,有效地將另一個HTML頁面嵌入到當(dāng)前頁面中??商鎿Q標簽,可以設(shè)置寬度和高度。
<iframe src="https://www.baidu.com" name="xxx"></iframe>
- frameborder 可以設(shè)置邊框?qū)挾?,frameborder=0 邊框?qū)挾葹?
與<a>標簽一起使用
<iframe name=xxx src="#" frameborder="0"></ifrme>
<a target="xxx" >QQ</a>
表示在xxx中打開頁面。
a標簽
跳轉(zhuǎn)頁面(HTTP GET請求)
<a >
- href 鏈接地址
href=“#” 頁面錨點變成#,回到頁面頂部 - target
target="_blank" 新窗口打開
target="_self" 當(dāng)前頁面加載
target="_parent" 在當(dāng)前頁面的父級加載
target="_top" 頂層窗口打開 - name 或 id 屬性
創(chuàng)建一個文檔內(nèi)部的書簽(也就是說,可以創(chuàng)建指向文檔片段的鏈接)
<a href="#屬性"> - download
下載,
<a href="/images/myw3schoolimage.jpg" download="w3logo">下載</a>
偽協(xié)議
<a href=" javascript: alert(1); ">xxx</a>只執(zhí)行js,不是url
<a href=" javascript:; ">xxx</a>點擊后沒有任何動作,滿足一些奇葩要求。
form標簽
跳轉(zhuǎn)頁面(HTTP POST 請求)
表示文檔中的一個區(qū)域,這個區(qū)域包含有交互控制元件,用來向web服務(wù)器提交信息。
<a href="index2.html">link</a>
<form action="index2.html" method="post">
<input type="submit" value="提交">
</form>
- 如果form表單里面沒有提交按鈕,那么就無法提交,除非用js。
- action 指定請求路徑
- method 指定請求動作(get post)
- name 出現(xiàn)在請求的第四部分 key:value
- get 會把參數(shù)默認放到查詢參數(shù),不會出現(xiàn)在請求的第四部分
- post 會把參數(shù)默認放到第四部分,可以使用 ?name=xxx 出現(xiàn)在查詢參數(shù)位置
- form 標簽跟a標簽一樣也有target屬性,使用方式相同
input和button標簽
區(qū)別:是否為空標簽,input為空標簽,
<input type="submit" value="提交">
<button>提交</button>
- 如果一個form表單中只有一個button按鈕
<button>button</button>,那么會自動升級為提交按鈕。如果是加了type。<button type="button">button</button>則按照type相同。 -
<input type="submit" value="button">提交 submit是唯一的可以用來提交的按鈕
input標簽
<input type="checkbox" id="xxx"><label for="xxx">你好</label>和
<label><input type="checkbox">你好</label>作用相同。input中的id和label中的for是對應(yīng)的。添加name屬性才能把參數(shù)提交到服務(wù)器。
radio 單選框,指定同一個name,才能單選。
select 下拉框,disabled 不可選擇, selected 默認選擇,multiple 可多選。
table標簽
<table>
<thead>
<tr>
<th>姓名</th><th>班級</th><th>分數(shù)</th>
</tr>
</thead>
<tbody>
<tr>
<td>姓名</td><td>班級</td><td>分數(shù)</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>姓名</th><th>班級</th><th>分數(shù)</th>
</tr>
</tfoot>
</table>