Sub topic 10
Making Trust Elements Accessible and Fast
This chapter assumes you know basic HTML and CSS, and that you have already placed testimonials, logos, reviews, and guarantees on a page. Trust elements are often image-heavy and sit high on the page. If they are slow or unreadable to some visitors, they cost you the trust they were meant to build.
Why these elements need extra care
Trust elements share three risks:
- Logos and portraits are images, so they can shift the layout and slow loading.
- Ratings are often shown only as stars or color, which screen readers and color-blind visitors may miss.
- Badges and widgets from other companies often load third-party scripts that block rendering.
The sections below address each one.
Give images text alternatives that match their job
The alt attribute should say what the image contributes, not what it looks like.
| Image | Alt text | Reason |
|---|---|---|
| Customer logo in a list of customers | The company name, such as `Example Co` | The logo is the only place the name appears |
| Portrait next to a named testimonial | Empty: `alt=""` | The name is already in the text, so the image is decorative |
| Logo that sits next to the company name in text | Empty: `alt=""` | Reading the name twice adds noise |
| Security badge | What it states, such as `Payments secured by Example Pay` | It carries a claim |
Do not write "logo of" or "photo of". Screen readers already announce that the element is an image.
Use structure that assistive technology understands
A logo strip is a list of customers, so mark it up as one. Label the section so screen reader users can jump to it.
<section aria-labelledby="customers-heading">
<h2 id="customers-heading">Teams that use Acme</h2>
<ul class="logo-strip">
<li><img src="/logos/example-co.svg" alt="Example Co" width="120" height="32" loading="lazy"></li>
<li><img src="/logos/sample-labs.svg" alt="Sample Labs" width="120" height="32" loading="lazy"></li>
<li><img src="/logos/demo-works.svg" alt="Demo Works" width="120" height="32" loading="lazy"></li>
</ul>
</section>Testimonials work best as figure, blockquote, and figcaption. This keeps the quote and the person who said it together in the reading order.
Ratings need text. A row of five star icons tells a screen reader nothing. Put the value in text, and hide the decorative stars.
<p class="rating">
<span aria-hidden="true">★★★★★</span>
<span>4.6 out of 5 from 212 reviews</span>
</p>Sighted visitors see the stars and the sentence. Screen reader users hear only the sentence.
Do not rely on color or low contrast
Muted grayscale logos look tidy, but they must stay visible. Text in a testimonial, a guarantee, or a rating needs a contrast ratio of at least 4.5:1 against its background (WCAG AA for normal text). Logos are exempt from contrast rules, but a logo faded so far that nobody can read it does no work. Keep the opacity high.
.logo-strip {
display: flex;
flex-wrap: wrap;
gap: 1.5rem;
align-items: center;
list-style: none;
padding: 0;
}
.logo-strip img {
height: 32px;
width: auto;
filter: grayscale(1);
opacity: 0.8;
}If a badge or logo links somewhere, such as a certification page, make sure the link has a visible focus style and text or alt text that says where it goes.
Prevent layout shift
Cumulative Layout Shift (CLS) measures how much content jumps while the page loads. A logo strip that loads late and pushes the call to action down is a common cause.
The fix is to set width and height attributes on every image. The browser uses them to reserve space before the file arrives. In the CSS above, width: auto with a fixed height keeps the aspect ratio for logos of different shapes.
Reserve space for widgets too. If a third-party review widget loads into an empty div, give that div a min-height close to the final size.
Load only what is needed, when it is needed
- Add
loading="lazy"to images below the first screen, such as the logo strip or portraits further down. - Do not lazy-load an image in the first visible screen. A hero testimonial portrait should load normally, or the browser delays the largest visible element.
- Prefer SVG for logos. They are small and stay sharp at any size.
- Resize portraits to about twice their displayed size (for example 96 by 96 for a 48 by 48 slot) and use a compressed format such as WebP or AVIF.
- Avoid carousels for testimonials. They hide content, need controls that keyboard and screen reader users can operate, and add script. A short static list is faster and easier to use.
A quick check
The diagram shows the order to work through when you audit a trust element.
Then run these checks:
- Tab through the section with only the keyboard. Every link must show focus.
- Turn on a screen reader and listen to the section. You should hear customer names and the rating value.
- Run Lighthouse and look at CLS and Largest Contentful Paint before and after adding the element.
Exercise
A page shows a testimonial with a 48 by 48 portrait of Dana Ortiz, and the caption reads "Dana Ortiz, Operations Lead at Example Co." What alt text should the portrait have, and which two attributes prevent layout shift when it loads?
Show answer
The alt text should be empty (alt=""), because the name is already in the caption and the image is decorative. The width and height attributes reserve the space before the image loads, so the layout does not shift.
Exercise
A rating is shown as five star icons and no text. Name two ways this fails visitors, and give one fix.
Show answer
Screen reader users get no value, and visitors who cannot see the star colors or fills cannot tell the score. Fix it by adding visible text such as "4.6 out of 5 from 212 reviews" and marking the star icons with aria-hidden="true".