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