我不知道为什么我在
http://validator.w3.org/check检查我的页面时一直收到此错误
错误是:
错误是:
Line 46,Column 68: The for attribute of the label element must refer to a form control. <label class="environment-label" for="environment_form">Environments:</label>
我相信我为我的标签提供了外部表格的id引用,为什么它一直在告诉我这个错误?
<div> <form id="environment_form" method="post"> <div class="styled-select"> <label class="environment-label" for="environment_form">Environments:</label> <select name="environment_dropdown" onchange="selectionChanged()"> <option @(ViewData["selection"] == null || string.IsNullOrEmpty(ViewData["selection"].ToString()) ? "selected" : "")>select one</option> @foreach (string name in Model) { <option @(ViewData["selection"] != null && ViewData["selection"].Equals(name) ? "selected" : "")> @name </option> } </select> </div> </form> </div>