Web accessibility is a key element in providing websites and applications that are easy to use for everyone. In recent years, accessibility has become increasingly important not only from legal requirements but also from an SEO perspective. In this article, we will explain the basics of “accessibility-friendly HTML markup” that front-end engineers should be aware of.
Using semantic HTML tags
The basis of accessibility is the use of appropriate HTML tags (semantic HTML). Rather than overusing meaningless tags such as div and span, choose tags that reflect the meaning of the content.
- Heading tags (
h1toh6): Use them correctly and in order to clarify the structure of the page. Screen reader users rely on headings to navigate pages. - Navigation (
nav): Encloses a menu, list of links, etc. to clearly indicate that it is the primary navigation. - Main Content (
main): Indicates the main content area of the page. Basically, place only one on a page. - Section (
section/article): Used to separate content or as an independent article block.
Form accessibility
Forms are important elements that accept input from users, but they are also areas where accessibility is often compromised.
labelassociation: Be sure to associate thelabeltag with the input form. By matching theforandidattributes, or surrounding theinputtag with alabeltag, the clickable area will be expanded and will be read correctly by screen readers.- Indication of required items: Use the
requiredattribute or clearly indicate that the item is required visually or textually. - Providing error messages: If there is an error when submitting the form, it is necessary to clearly communicate which item is incorrect (for example, use
aria-describedbyto link input fields and error messages).
Utilizing WAI-ARIA (only in appropriate situations)
For dynamic UI (modals, tabs, accordions, etc.) that cannot be expressed using only basic HTML tags, we utilize WAI-ARIA (Web Accessibility Initiative - Accessible Rich Internet Applications).
aria-label/aria-labelledby: Provides a name for buttons without visual text (such as icon buttons).aria-hidden="true": Use for elements that you do not want screen readers to read, such as decorative icons.aria-expanded: Tells whether an accordion menu, etc. is open or closed.
However, as the principle goes, “No ARIA is better than bad ARIA,” it is important to prioritize the use of native HTML elements (<button>, <dialog>, etc.) first.
Summary
Markup with accessibility in mind is not a special technique, but a process that goes back to the basics of ``writing HTML correctly.’’ By being aware of semantic HTML from the early stages of development and checking with keyboard operations and screen readers, you can create products that are easy to use for more users. Please try putting it into practice in your daily coding.

