体育平台app Web Design, LLC
aims to improve business by delivering effective solutions based on innovative technologies and professional designs. Discover the variety of services we offer and convince yourself on the basis of the latest works that we've done. We love building fresh, unique and usable websites optimized specifically for your niche.
Eric is a Boston-based designer who helps create straightforward solutions that address a person’s practical, physical, cognitive, and emotional needs.
More about Eric ↬
[1]
Image placement on the modern web is highly intentional, helping to communicate the overall purpose of a page or view. This means that nearly every image you declare needs to have an alternate description.
The
img
element’s
alt
attribute
[2]
can be “nulled,” which is the act of setting it to an empty string instead of a text description. Nulling an alt description means there is no information between the opening and close quotes. If there is an empty space, it will not be considered nulled:
This image has been nulled.
This image has not been nulled.
What Does “Decorative” Mean?
Nulling an image indicates that it is for decorative purposes only.
In this context, decorative means that the image
does not visually communicate information
that is important to understanding the purpose of the page or view, and why the image is included as a part of that.
View of Rotterdam, by Cornelis Boumeester. Date: about 1700–20. Accession Number: 2005.1057. In Dutch homes, tiles typically served utilitarian purposes, such as covering the walls of kitchens, utility rooms, passageways, and fireplace surrounds.
Assistive technology will skip over nulled images and not announce their presence. The reasons for wanting to do this are mostly historical.
Old Layout Techniques
Early web development techniques relied on images to help them guarantee
consistent layout
across different operating systems, browsers, and browser versions. The most common example of this was a
spacer.gif
[6]
, a 1×1 transparent pixel that was stretched to different sizes to push content into place.
Three stretched spacer.gifs used to create an outer margin for the text, “Welcome to my homepage.” (
Large preview
[7]
)
This technique would typically use many
spacing images
to create a visual design. Without a way to silence their presence, these images would clutter up what assistive technology announced and make it confusing and time-consuming to navigate and take action on web content.
Old Design Techniques
Before there were CSS properties such as
box-shadow
[8]
, developers had to use techniques that chopped up the decorative styling to make it work with content of indeterminate height or width. This technique was called
9-slice scaling
[9]
, a term that refers to the 9 sections of content you would need to create.
Much like spacer images, 9-slice scaling used multiple images to create the desired visual effect. And, much like spacer images, the only way to
remove the clutter
these images created was to mark them as decorative.
Redundant Announcements
There is the rare scenario where an image is repeated on a page or view, and it’s repeat placements don’t supply any additional context. You should be careful about marking an image decorative in this situation, as the lack of an announcement for a visible image may be confusing for
someone with low vision who is using a screen reader
[11]
.
Supplemental Icons
Links and buttons that use icons should always have
an accessible name
[12]
that communicates functionality. If the design also incorporates an icon, the icon’s design does not need to be communicated.
If the component only uses an icon, the image itself should be used to create the accessible name:
Modern CSS layout
[15]
and styling techniques means that image placement is now highly intentional. This means that if an image is used, it is most likely going to need an alternate description.
There are a few other ways to display an image on a page or view. It is important to ensure an alternate description is provided if the image contains
meaningful content
— regardless of the technique utilized.
The
picture
Element
The
picture
element
[17]
does not have
an implicit role
[18]
, meaning that its presence does not communicate any purpose to assistive technology. This means it can’t be used to semantically describe the presence of a “picture.”
The
picture
element is a container for
source
and
img
elements. Use the
img
element’s
alt
attribute to provide an alternate description for the parent
picture
element.
Background Images
We can use CSS to declare an image as a background on an HTML element. This is most often used to add a sense of texture to a design.
However, another popular technique is to use a
background-image
to place an image in such a way where the developer will not have control over the
size of the image
someone uploads.
background-image
, combined with other properties such as
background-size
[19]
will ensure that content of an unknown size is displayed without breaking the design.
See the Pen [Background Image As Foreground Image Example](https://codepen.io/smashingmag/pen/OJprPwK) by
Eric Bailey
[20]
.
In modern web design and development, displaying an image is a highly intentional act. Alternate descriptions allow us to explain the content of the image, and in doing so,
communicate why it is worth including
.
Just because an image displays something fanciful doesn’t mean it isn’t worth describing. Announcing its presence ensures that
anyone, regardless of ability or circumstance
[25]
, can fully understand your digital experience.