【发布时间】:2019-04-04 19:07:25
【问题描述】:
我一定遗漏了一些明显的东西 - 为什么这个页面没有在 Google Chrome (Lighthouse) 审核中验证?
<!doctype html>
<html lang="en">
<head>
<title>Label Test</title>
</head>
<body>
<form action="form.php" method="post">
<label>
<input name="phrase" id="phrase" type="text">
</label>
</form>
</body>
</html>
上面写着:
“表单元素没有关联的标签。”失败的元素:
<input name="phrase" id="phrase" type="text">
(我尝试使用<label for="phrase",但仍然失败。
【问题讨论】:
-
</label>需要放在<input>之前:w3.org/WAI/tutorials/forms/labels
标签: google-chrome label lighthouse