table表格,form表單


(1)table 表格標簽:

  table設置  border:1;屬性,單元格帶邊框的效果;

    style="border_collapse:collapse;"表格中很細表格邊線的制作;

  tr : 每行;

  td : 每行單元格的數據;

(2)form表單標簽:

  action : 提交的地址;

  method : 提交的方式 :  get(不安全) , post(相對安全)

<!--如果action為空,那么默認是打開頁面的地址
缺點:form只能做提交操作,form表單不能接收數據.
-->

  input表單控件:

    type : text:明文顯示用戶輸入的數據;

         password 密文顯示用戶輸入的數據;

       radio 單選按鈕;

         checkbox : 復選框;

          file : 上傳文件所用;

       submit : 功能固定化,負責將表中的表單控件提交給服務端;

    value : 控件的值即要提交給服務器的數據;

    name : 控件的名稱 , 服務端用;

    disabled : 該屬性只要表現在標簽中,表示的是禁用該控件;

  注意 : 如果有文件需要提交給服務器,method必須為post , enctype必須為multipart/form_data

  狀態碼簡單介紹:

    200以上 : 表示成功請求的狀態碼;

    300以上 : 緩存;

    400以上 : 404網頁加載失敗,前端出錯;

    500以上 : 后端邏輯出錯,后端業務邏輯出錯;

協議     主機地址  端口號  路由地址

http : // locahost : 8080/s/a

表單控件 : 

  input: type: text : 文本輸入框;

       password : 密碼;

       radio : 單選;

          checkbox : 多選;

       file : 文件上傳;

       submit : 提交按鈕;

       bottom : 普通按鈕;

  select : option      text area : 多行文本輸入框;

  

  以下是例子:

<label for="user">用戶名</label>
<input type="text" name="username" value="" id="user"><br>
密碼: <input type="password" name="password"><br>
性別: <input type="radio" name="gender" value="male" checked>男
<input type="radio" name="gender" value="female" >女<br>
愛好: <input type="checkbox" name="love" value="eat">吃飯
<input type="checkbox" name="love" value="sleep">睡覺
<input type="checkbox" name="love" value="bat" checked>打豆豆
<!--如果是form表單提交,type一定是submit-->
<br>
<input type="submit" value="登錄">
<input type="button" value="登錄2">
<button type="submit" disabled>注冊</button>
<input type="reset" value="重置按鈕" id="re"><br>
<input type="file" value="文件選擇框">
<select multiple="" size="3">
<option >小學</option>
<option >初中</option>
<option >高中</option>
<option >大學</option>
<option >研究生</option>
</select>
<textarea name="" id="" cols="50" rows="20"></textarea>
</form>
<form>
<fieldset>
<legend>賬號信息</legend>
姓名: <input value="呵呵">逗比<br>
密碼: <input type="password" value="pwd" size="50"><br>
</fieldset>
<fieldset>
<legend>其他信息</legend>
性別: <input type="radio" name="gender" value="male" checked="">男
<input type="radio" name="gender" value="female">女<br>
愛好: <input type="checkbox" name="love" value="eat">吃飯
<input type="checkbox" name="love" value="sleep">睡覺
<input type="checkbox" name="love" value="bat" checked>打豆豆
</fieldset>

  前端跟后端進行交互有兩種方式 :

  1. form標簽提交 : 如果是get請求,那么會把表單控件input中的name屬性對應的值封裝成地址欄的key,value值封裝成地址欄的value,打包發送到后端,后端進行相應的處理.

  2.Ajax技術

css : 層疊樣式表

  三種引入方式 : 1. 行內樣式     優先級最高

         2.內接樣式 : 基礎css選擇器:

                id選擇器

                class選擇器

                標簽選擇器 : div

                通配符選擇器:*{}

            高級選擇器 : 

                  后代(兒子,孫子 .....)選擇器 : div p

                  子代(親兒子)選擇器 : div>p

          3. 外接樣式

    placehdder   在input里把字變成虛字

    em根據當前文字的大小

 


免責聲明!

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



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