表單/iframe與video標簽


 

<form action="所有表單值提交的地址" method="傳值的方式默認是GET方式,還有另一種POST方式">
表單元素
</form>-->

<!--提交方式:
1.get:
所有表單的數據以鍵值對的方式 key=value的方式傳遞給后台
url:請求地址?key1=value1&key2=value2&key3=value3&.....
缺點:不安全,傳遞的內容大小有限制
2.post:
不會顯示表單數據
安全性高,傳遞的內容大小基本沒有限制
表單元素通用格式:
<input type="表單元素的類型" name="鍵" value="值">
placeholder:這個屬性為在文本框中做一個提示的格式
value:作為一個值,如果值填寫"zhangsan" 則網頁上這個文本框就默認zhangsan
表單元素的類型:
1.文本類型:
text:文本框
password:密碼框
hidden:隱藏域
2.按鈕類型:
button:普通按鈕
submit:提交按鈕
reset:重置按鈕
3.單選/多選類型:
1.radio:單選(必須搭配name屬性使用,name屬性值一致才可以。)
2.checkbox:多選
屬性為checked這是一個默認屬性,相當於勾選了之后,刷新之后默認選中。必須在input標簽中都可以使用★
disabled屬性 不可編輯可以在input中以及下拉框(select)中使用★
4.文件:
file:文件上傳 ★
要是填寫file文件上傳時,必須要在form標簽中添加
formenctype="multipart/form-data"(控制的后期提交文件給服務器的效果)
5.下拉框標簽:
<select>
<option>選項1</option>
<option>選項2</option>
<option>選項3</option>
</select>
selected屬性:默認選中,此屬性在select下拉框中才能使用,不可在input中使用。★
6.文本域標簽:
 <textarea></textarea>
-->

代碼如圖:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>表單</title>
</head>
<body>
<form action="#" method="post" formenctype="multipart/form-data">
  用戶名:<input type="text" name="username" placeholder="請輸入用戶名" ><br>
  密碼:  <input type="password" name="pwd"><br>
  隱藏域: <input type="hidden" name="uid" value="123"><br>
  <input type="button" value="普通按鈕"><br>
  <input type="submit" value="提交按鈕"><br>
  <input type="reset"  value="重置按鈕"><br>
  性別: 
<!-- 單選-->
	<!-- label標簽:點擊框的時候不好點,可以直接點擊文字進行勾選。-->
      <label>男<input type="radio" name="sex" value="man" checked></label>
	  <label>女<input type="radio" name="sex" value="woman"></label><br>
<!--多選-->
  愛好:
      <label>
      	起凡<input type="checkbox" name="hobby" value="football" >
      </label>
      <label> 
     	 神武3<input type="checkbox" name="hobby" value="basketball">
      </label>
      <label>
      	 英雄聯盟<input type="checkbox" name="hobby" value="volleyball">
      </label><br>
    文件上傳:
<!-- 要是填寫file文件上傳時,必須要在form標簽中添加
     formenctype="multipart/form-data"(控制的后期提交文件給服務器的效果)-->
     <input type="file"><br>
    地址:
     <select name="address">
     	 <option value="dema">德瑪西亞</option>
     	 <option value="aiou" selected>艾歐尼亞</option>
     	 <option value="niaoguo">鳥國嘚嘚</option>
     </select><br>
   <!--  文本域-->
     <textarea name="text1" cols="30" rows="10">
     	
     	
     	
     	
     </textarea>
	
	
</form>
</body>
</html>

  ifream標簽:

<!--
內嵌框架標簽
<iframe name="標簽名字" src="嵌套網頁地址"></iframe>
要是連接起來就給iframe一個name名字,再在其他的頁面添加屬性target="名字跟iframe里面的name值一樣即可"
-->
<!--
視頻標簽★★★★★
<video src="視頻地址"></video>
controls:控制條,播放的屬性得點擊才能播放
autoplay:這是自動播放視頻的屬性
loop:循環播放

網頁圖標格式:找到自己要的圖,在網站上搜索ico轉換器點開第二個,然后下載。下載完之后改為ico后綴名,保存到自己想要的路徑,然后在HTML頁面link
<link rel="icon" href="a.ico" type=" image/* ">
-->

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>iframe/video標簽</title>
<link rel="icon" href="a.ico" type="image/*">
</head>

<body>
<a href="first.html" target="myhtml">天氣</a>
<a href="second.html" target="myhtml">新聞</a>
<a href="third.html" target="myhtml">圖片</a>
<br>
<iframe src="https://www.baidu.com" frameborder="1" width="800px" height="400px" name="myhtml">
	
	
	
</iframe>
<video src="https://fus.cdn.krcom.cn/001Fd58Alx07suhjMIrC0104120cPiDp0E050.mp4?label=mp4_1080p&template=1920x1080.20.0&Expires=1553583752&ssig=xkLeaw9%2FZX&KID=unistore,video"  controls="controls" autoplay loop>
	
</video>
</body>
</html>

  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM