DEV Community

Cover image for Web Accessibility: A Web for Everyone by Empowering Inclusion and Equal Access for All
David Adeaga
David Adeaga

Posted on • Edited on

Web Accessibility: A Web for Everyone by Empowering Inclusion and Equal Access for All

Table of content:

Introduction

In today's connected world, the internet has shaped how we learn, work, communicate, and access information, becoming a crucial part of our daily lives. The internet presents a lot of opportunities for empowerment, knowledge sharing, and economic development with its vast selection of websites, applications, and digital services. However, while the internet has unlocked a world of opportunities, it has also unintentionally put obstacles in the way of some people, excluding them from its abundant resources.

The concept of "Web for Everyone" prioritized inclusion, accessibility, and equal access for all users, regardless of their skills, backgrounds, or technological resources. It highlights the significance of creating web experiences that cater to the diverse needs of people with disabilities, the elderly, those living in areas with low bandwidth, and users dealing with a range of socioeconomic challenges.

In this article, We delve into the significance of empowering inclusion in web development and how it can contribute to an online environment that is more equitable. We look at the fundamentals of accessibility as well as the tools and methods that web designers can use to create truly inclusive web experiences that make sure no one is left out of the digital revolution.

History of netizens and the web

The World Wide Web was created in the early 1990s, and the idea of netizens, or citizens of the internet, started to take shape. Initially, the web primarily catered to a niche group of tech enthusiasts, academics, and researchers. Accessibility wasn't a major issue during this time because most people used desktop computers with straightforward text-based user interfaces to access the internet.

Graphical user interfaces spread as the web gained popularity. Users with disabilities, however, faced difficulties as a result of this transition. For example, image-based content that lacked alternative text descriptions created barriers for the visually impaired and made it challenging for screen readers to effectively communicate information.

Organizations and standards bodies started pushing for a more inclusive web in response to growing accessibility concerns. The World Wide Web Consortium (W3C) launched the Web Accessibility Initiative (WAI) in 1999. WAI concentrated on developing policies and procedures to improve the accessibility of the web for those with disabilities. The Web Content Accessibility Guidelines (WCAG) framework has become a vital tool for developers to use when creating accessible websites.

While significant progress has been made, web accessibility remains an ongoing challenge. The rapid evolution of technology, including the Internet of Things (IoT), artificial intelligence (AI), and virtual reality (VR), brings new accessibility considerations to the forefront. Ensuring equal access for all netizens will continue to be a vital aspect of the web's future.

Measuring color contrast for visually impaired users

To ensure that digital content is readable and usable by all users, including those with visual impairments, color's role in accessibility, particularly regarding contrast, is essential. The difference in luminance (brightness) between two colors—typically the color of the background and the foreground text—is referred to as contrast. Regardless of a user's visual abilities, a sufficient contrast ratio is necessary to make content readable and distinguishable.

Here is an example of how to text for contrast while building an application using Chrome DevTool.

  • Open the web page you want to analyze in Google Chrome.

  • Open Chrome DevTools by right-clicking on the page and
    selecting "Inspect" or pressing the F12 key on Windows/Linux or Cmd + Option + I on macOS.

  • In DevTools, click on the "Elements" tab to inspect the HTML structure of the page.

  • Locate the element that contains the text whose color contrast you want to measure. You can do this by hovering over the elements in the "Elements" panel to highlight them on the page.

  • Once you've identified the element, click on it in the "Elements" panel. This will bring up the "Styles" section on the right-hand side of DevTools, showing the CSS styles applied to the element.

An example of a good color contrast.
Image description

Understanding the power of alternative text

Alternative text, also known as "alt text," is a vital component of web accessibility that improves the usability of websites for people with visual impairments. Screen readers can now convey information to users who are unable to directly perceive these visual elements by using alt text, which offers a text-based alternative to non-text content like images, graphics, and multimedia elements. It guarantees that everyone can understand and interact with the content on a website, regardless of their knowledge or skills.

There are numerous benefits to using a proper, concise, and yet descriptive alt text for images, ranging from better SEO (Search Engine Optimization), great accessibility, Compliance with WCAG (Web Content Accessibility Guidelines), and an awesome user experience. These benefits are the benchmark for a well-performing product that prioritizes inclusion. However, alt text can be excluded for certain images that are not important for SEO, such as a landing page image. This can be achieved by giving the image an empty alt value, which will force a screen reader to omit this image.

A simple code example of an alternative text

<!DOCTYPE html>
<html>
<head>
    <title>Alt Text Example</title>
</head>
<body>
    <h1>Mountain Landscape</h1>
    <img src="mountain.jpg" alt="Scenic view of a majestic mountain landscape with snow-capped peaks and a serene lake in the foreground.">
</body>
</html>
Enter fullscreen mode Exit fullscreen mode

A practical example of using WAI ARIA label for custom component development

Let's look at a real-world example of how to improve the accessibility of a custom tabbed component using WAI-ARIA (Web Accessibility Initiative: Accessible Rich Internet Applications) attributes. A common user interface element used to structure and organize content presentation is a tabbed component.

In this example, we will be creating an accessible tab component using HTML, CSS, and WAI-ARIA attributes to improve accessibility for screen reader users.

HTML Structure

<!DOCTYPE html>
<html>
<head>
    <title>Accessible Tabbed Component</title>
    <link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
    <div class="tabbed-container">
        <button class="tab" role="tab" aria-selected="true" aria-controls="tab-content-1">Tab 1</button>
        <button class="tab" role="tab" aria-selected="false" aria-controls="tab-content-2">Tab 2</button>
        <button class="tab" role="tab" aria-selected="false" aria-controls="tab-content-3">Tab 3</button>
    </div>
    <div id="tab-content-1" class="tab-content">Content for Tab 1</div>
    <div id="tab-content-2" class="tab-content">Content for Tab 2</div>
    <div id="tab-content-3" class="tab-content">Content for Tab 3</div>
</body>
</html>
Enter fullscreen mode Exit fullscreen mode

CSS (Styles)

.tabbed-container {
    display: flex;
    justify-content: space-between;
}

.tab {
    padding: 10px 20px;
    background-color: #f0f0f0;
    border: none;
    cursor: pointer;
}

.tab-content {
    display: none;
    margin-top: 10px;
}

.tab-content[aria-hidden="false"] {
    display: block;
}

Enter fullscreen mode Exit fullscreen mode

In this example, we've created a basic tabbed component with three tabs and corresponding content panels. To enhance accessibility, we've used WAI-ARIA attributes:

  • role="tab" : Indicates that the button element serves as a tab.

  • aria-selected : Indicates whether a tab is currently selected (true) or not (false).

  • aria-controls : Associates each tab with the corresponding content panel.

We've also used aria-hidden in the CSS to control the visibility of the tab content based on its selected state.

Understanding WCAG (Web Content Accessibility Guidelines) and its compliance requirements

The Web Accessibility Initiative (WAI) of the World Wide Web Consortium (W3C) created a set of guidelines known as the Web Content Accessibility Guidelines (WCAG). These recommendations are made to guarantee that digital content, such as websites and web applications, is accessible to those who have disabilities. No matter a user's abilities, WCAG offers a framework for producing content that is perceivable, operable, understandable, and robust.

WCAG is organized into four main principles, each of which is supported by specific guidelines and success criteri. The principles or benchmark for a website is for them to be perceivable, operable, understandable and robust. It also has three level of comformancy.

A, AA, and AAA are the three levels of WCAG conformance. With Level A being the most fundamental and AAA being the highest level of accessibility, each level builds on the prerequisites of the one before it. Since it strikes a good balance between accessibility enhancements and implementation effort, the AA level is frequently regarded as the ideal for the majority of websites and applications.

Here is a link to learn more about this guidelines from the WCAG website.

In conclusion, web accessibility is not merely an optional feature but a fundamental necessity for creating an inclusive and equitable digital space for all. As the internet becomes an increasingly integral part of our daily lives, it is crucial to ensure that individuals with disabilities can participate fully and benefit from its vast resources.

Top comments (0)