DEV Community

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

Posted on

6

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.

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more