Custom CSS


 Make Elements Only Visible to a Screen Reader by Using Custom CSS:

 The importance of using a logical document outline and semantically meaningful tags around your content before introducing the visual design aspect.

However, CSS's magic can also improve accessibility on your page when you want to visually hide content meant only for screen readers.

 This happens when information is in a visual format (like a chart), but screen reader users need an alternative presentation (like a table) to access the data.

 CSS is used to position the screen reader-only elements off the visual area of the browser window.

Here's an example of the CSS rules that accomplish this:

.sr-only {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  top: auto;
  overflow: hidden;
}

Note: The following CSS approaches will NOT do the same thing:

display: none; or visibility: hidden; hides content for everyone, including screen reader users

Zero values for pixel sizes, such as width: 0px; height: 0px; removes that element from the flow of your document, meaning screen readers will ignore it.

Avoid Colorblindness Issues by Carefully Choosing Colors that Convey Information:

There are various forms of colorblindness.

 These can range from a reduced sensitivity to a certain wavelength of light to the inability to see color at all. 

The most common form is a reduced sensitivity to detect greens.

For example, if two similar green colors are the foreground and background color of your content, a colorblind user may not be able to distinguish them. 

Close colors can be thought of as neighbors on the color wheel, and those combinations should be avoided when conveying important information.

Note: Some online color picking tools include visual simulations of how colors appear for different types of colorblindness. 

These are great resources in addition to online contrast checking calculators.

No comments:

Post a Comment