Tips For Making Coding Websites Accessible
Keeping your website accessible is not as daunting a task as it may seem! Here are a few simple tips you should have in mind while you are coding:
Alternative Text: The alternative text serves two main purposes:
- Provide users with visual impairments a description of what that image represents.
- If an image is not loading due to slow internet or other issues, users can use that description to know what is missing from the page.
Title Tag: The <title> tag in HTML is used to define the title of HTML document. It sets the title in the browser toolbar. It provides the title for the web page when it is added to favorites. It displays the title for the page in search engine results.
Headings: If you are using a heading because you like the font size, stop being lazy and use CSS. Headings play an important role in keeping your website structure accessible. Users that rely on a screen reader to navigate the web can go through a website’s content each heading at a time. The screen reader will go through the headings in order and if you use them correctly, you can make your website more organized and easier to navigate.
- The h1 tag should only be used for the title of the page.
- The h2 tag is used for the sub-categories. Example: If you are creating a website discussing each character on the TV show Friends, you should use h1 for the title “Friends” and h2 for each character (Rachel, Monica, Phoebe, Chandler, Joey, and Ross).
- Do not overuse headings. If you need more than h3 you’re probably using it too much and your website could be difficult to navigate.
Labels: You should use labels to indicate the purpose of certain items on your page.
- If you have a button or a form on your page, you should use a label that indicates label of the button or form element. Again, it is very helpful for users who rely on screen readers
- ARIA labels are the best way to add accessible labels and descriptions. It overrides any other native labeling mechanism, such as the HTML label element.
Menus: For a drop-down menu to be accessible, the drop-down items need to stay on the screen. Otherwise, if the user accidentally hovers outside of the drop-down menu, they won’t be able to listen to the items anymore. Use on-click instead of hover to make sure the menu stays on the screen.
- If you want to make sure your website can be easily navigated but you don’t want to test your code with a screen reader with every change you make, use the TAB key on your keyboard!
- The screen reader will go through your website content in the same order the TAB key does.
Attention reader! Don’t stop learning now. Get hold of all the important Comcompetitivepetitve Programming concepts with the Web Design for Beginners | HTML course.