DEV Community

Cover image for A11y tips: the right element
Carlos Espada
Carlos Espada

Posted on

A11y tips: the right element

The first step to achieve an accessible website is to use the right HTML element at all times. Try to write a code that reflects the structure of your information, do not stay in a simple set of <div> and <span> which you will later style with CSS.

For example, if you want to make a button, don't simulate its behavior with a <div> that you fill in with CSS and JS to achieve what the browser already gives you natively. The browser can already do a lot of your work if you use <button>.

To find out how accessible each element of HTML5 is, you can use HTML5 Accessibility, which is up-to-date and offers very reliable information.

If the HTML that you deliver to the browser has a meaning, that will help any type of device to understand it and offer the user the best experience, and that includes a computer, a mobile phone, a tablet, a screen reader, a voice recognition software, a watch ...

Remember, accessibility starts with semantics.

Discussion (0)