HTML5 學習12 文字框和單選框

2021-10-07 06:45:11 字數 1471 閱讀 4025

|屬性| 說明 |

|-type-|-指定元素的型別。text、password、checkbox、submit、reset、file、hidden、image和button,預設為text-|

| name | 指定表單元素的名稱 |

| value | 元素的初始值。type為radio時必須指定乙個值 |

| size | 指定表單元素的初識寬度。當type為text或password時,表單元素的大小以字元為單位。對於其他型別,寬度以畫素為單位 |

| maxlength | type或password時,輸入的最大字元數 |

| checked | type為radio或checkbox,指定按鈕是否被選中 |

<

!doctype html>

"en"

>

"utf-8"

>

登入註冊<

/title>

<

/head>

註冊<

/h1>

<

!--表單form

method:post,get 提交方式

get 方式提交:我們可以在url中看到我們提交的資訊,不安全,高效

post :比較安全,傳輸大檔案

-->

"1.我的第乙個網頁.html" method=

"get"

>

<

!-- 文字輸入框 input type=

"text"

value=

"臧臧好帥" 預設初始值

maxlength=「8」 最長能寫幾個字元

size=「30」 文字框的長度

-->

名字:"text" name=

"username" value=

"臧臧" maxlength=

"8" size=

"30"

>

<

/p>

密碼:"password" name=

"psw"

>

<

/p>

<

!--單選框標籤

input type=「radio」

value :單選框的值

name :表示組

-->

性別: "radio" value=

"boy" name=

"***"

/>男

"radio " value=

"girl" name=

"***"

>女

<

/p>

"submit"

>

"reset"

>

<

/p>

<

/form>

<

/body>

<

/html>

html5 文字高亮顯示

實現 1.建立demo.css styles for the fokus demo page.author hakim el hattab selection html,body body aa hover h1,h2 intro intro intro h1 intro h1 after intr...

前端學習(7)文字框 單選框 多選框

表單元素格式 屬性1說明 type 指定元素的型別。text password checkbox radio submit reset file hidden image和button,預設為text name 指定表單元素的名稱 value 元素的初始值。type為radio時必須指定乙個值 si...

HTML 5種空格表示 對齊文字框

html提供了5種空格實體 space entity 它們擁有不同的寬度,非斷行空格 是常規空格的寬度,可執行於所有主流瀏覽器。其他幾種空格 在不同瀏覽器中寬度各異。它叫不換行空格,全稱no break space,它是最常見和我們使用最多的空格,大多數的人可能只接觸了 它是按下space鍵產生的空...