我在一個形式如何,當你試圖把一個頭和像「所有領域都需要,除非標記爲可選免責聲明詠歎調 - labelledby或詠歎調,describedby不確定「放棄您的表單頂部的免責聲明。我認爲這是我認爲已經完成的方式,但我對新的輔助功能很陌生,所以任何更正都將不勝感激!WCAG 2.0詠歎調 - labelledby表單頭和免責聲明
<form id="profile optional">
<h1 arialabelledby="profile">Profile</h1>
<p aria-describedby="optional">All fields are required unless marked optional</p>
<fieldset>
<legend id="userInfo" aria-labelledby="formA">User Info</legend>
<div class="form-control">
<label id="firstName" for="firstName">First Name</label>
<input type="text" name="firstName" aria-labelledby="firstName userInfo" aria-required="true" aria-describedby="error-message"/>
<span id="error-message" style="display:none" aria-hidden="true">Name is required</span>
</div>
<div class="form-control">
<label id="lastName" for="lastName">Last Name</label>
<input type="text" name="lastName" aria-labelledby="lastName userInfo" aria-required="true" aria-describedby="error-message"/>
<span id="error-message" style="display:none" aria-hidden="true">Name is required</span>
</div>
<div class="form-control">
<label id="nickName" for="nickName">Nick Name (optional)</label>
<input type="text" name="nickName" aria-labelledby="nickName userInfo"/>
</div>
<fieldset>
<fieldset>
...
</fieldset>
<button type="submit" aria-label="Submit Profile">Submit</button>
</form>
編輯*代碼提交按鈕
太棒了!我讀了更多關於ARIA的免費內容,以及在你提到它之後HTML5已經支持一堆可訪問性,所以非常感謝你們提供了一些啓發。我要去http://www.html5accessibility.com/,以確保我所做的一切都是可訪問性支持的,但有什麼棘手的問題我應該留意? –
HTML5Accessibility.com是一個很好的資源,我很高興你在尋找。至於技巧,如果你熟悉[使用ARIA的5條規則](https://www.w3。org/TR/aria-in-html /#notes-on-aria-use-in-html)並謹慎對待,我認爲你的狀態會很好。例如,我很高興看到你有興趣。 – aardrian