8
我不知道爲什麼,我不斷收到此錯誤,同時檢查我的網頁在http://validator.w3.org/check 錯誤是:錯誤驗證HTML:該爲標籤元素必須引用表單控件的屬性
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>
我我相信我爲我的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>
謝謝。我知道了 ;) – Chan 2012-07-19 19:00:58