用label有什么優(yōu)勢嗎,直接這樣不就行了
<!DOCTYPE html>
<html>
<head>
? ? <meta charset="UTF-8">
? ? <title>表單標簽</title>
</head>
<body>
? ? <form method="post" action="save.php">
? ? ? ? 用戶名:<input type="text" name="username" placeholder="請輸入賬號" />
? ? ? ? 密碼:<input type="password" name="pass" placeholder="請輸入密碼" />
? ? ? ? <input type="submit" value="確定" name="submit" />
? ? ? ? <input type="reset" value="重置" name="reset" />
? ? </form>
</body>
</html>
2020-07-02
label作用:
????1. <label>標簽的 for 和<input>標簽的 id 關(guān)聯(lián),點擊 label 的時候可以選中 input。
????2. 語義化,通常用來做 <input> 標簽的內(nèi)容標記。
示例:
2020-06-17
你的提問很好,我也想得到最好的答案?
2020-06-15
<form method="post" action="save.php">
? ? ? ? <label for:name>用戶名:</label>
????????<input type="text" name="username" placeholder="請輸入賬號"? id="name"/>
用了label? 同時給input一個ID屬性 可以讓你在界面點擊用戶名的時候 跳轉(zhuǎn)到用戶名輸入框里 方便用戶操作吧? ?
2020-06-15
label的文字點擊就會直接打開輸入框,不用點擊輸入框這樣子的