Accessibility, Privacy and Cookies: Checks a Site Owner Can Run
Check the accessibility of a builder-made page with automatic tests for colour contrast, image text, form labels and link names, and check a cookie plan against a simple consent rule, with both audits implemented in two languages.
In this lesson you will
- Run basic accessibility checks on a page
- Compute contrast from the colours in a page
- Classify scripts by cookie category
- Check that nothing optional loads before consent
About 28 minutes
A site everyone can use, and that respects its visitors
Priya’s builder offers beautiful templates, and templates are not automatically accessible. A site is accessible when people with disabilities, such as blindness, low vision, colour blindness, tremor or deafness, and people in difficult situations, such as bright sunlight, can use it. The main checks are the same as in the Front-end course, and a no-code owner can run them without writing code: text must have enough contrast with its background, every meaningful image needs alt text, every form field needs a label, links need names that make sense out of context, and the whole site must work with a keyboard. Many countries now have accessibility laws that apply to businesses, which differ and change, so check the rules for your location.
Privacy has its own checks. Many sites load scripts from other companies: analytics, advertising, social media buttons and chat widgets. Some of them set cookies or collect personal data. In many places the law requires that visitors agree before the optional ones run, while strictly necessary ones, such as the cookie that remembers a shopping basket, need no consent. A simple rule that you can check: scripts in the categories analytics and marketing must not load before the visitor has given consent. A builder’s cookie banner usually does this when it is set up right, and a single custom code snippet pasted into the site header can break it. This lesson is not legal advice: it shows how to check your own plan against a rule you have been given, and rules differ between countries.
| Check | Why | Typical builder fix |
|---|---|---|
| Contrast 4.5 to 1 | Readable text | Change text or background colour |
| Alt text on images | Screen reader users | Fill the alt field of each image |
| Labels on fields | Screen readers and mobile | Turn on field labels in the form block |
| Descriptive links | Out-of-context link lists | Rename “click here” |
| Consent before analytics | Privacy rules | Set the banner to block categories |
<html lang="en"><body style="background:#fff8f0">
<h1 style="color:#8b4513">Pine & Honey</h1>
<p style="color:#b0a090">Hand-poured candles, made in small batches.</p>
<p style="color:#767676;background:#ffffff">Free delivery over 50 euros.</p>
<img src="lavender.jpg"><img src="pine.jpg" alt="Pine candle in a glass jar"><img src="divider.png" alt="">
<a href="/candles">Click here</a> <a href="/delivery">Delivery and returns</a>
<form><input id="email" type="email" placeholder="Your email"><label for="name">Name</label><input id="name"><button></button></form>
</body></html>
The audit found 5 problems on the sample page, written here in plain words as the program printed them: low contrast 2.41 in “Hand-poured candles, mad”; image without alt: lavender.jpg; field without a label: #email; vague link text: Click here; button without a name. Each one is fixable in a builder without code: change a colour, fill an alt field, turn on field labels, rename a link, and give the button a text. The contrast check read the colours from the style of each element, and from its parents when it had none, and applied the formula of the Front-end course: the light brownish grey of the second paragraph, #b0a090, on the cream background is too pale, and the heading brown on cream passes. Notice that the grey #767676 on white passes, exactly at the threshold, as a famous example, while slightly lighter greys do not.
Independent check: the same audit was written twice, once in JavaScript with a DOM and once in Python with a tokeniser and its own handling of inherited colours, and both produced the same list of problems. The empty alt on the divider image was not reported, since an empty alt is the right way to mark a decorative image. Automatic checks find only a part of the problems, so also try the page with only the keyboard, zoom it to 200 percent, and look at it on a phone in sunlight.
Plan A (a banner that blocks) ok
Plan B (a snippet pasted in the header) loads before consent: Analytics script, Ad pixel
Plan C (only necessary cookies) ok
The second check classifies each script of a site by cookie category and asks whether it waits for consent. In plan A, a cookie banner holds back the chat widget, the analytics script and the advertising pixel until the visitor agrees, and only the shop basket cookie, which is strictly necessary, runs at once: the check passes. In plan B, someone pasted the analytics and advertising snippets into the site header, so they load for every visitor from the first page view, before any choice, and the check names both. Plan C uses only necessary cookies and needs no banner at all, which is the simplest way to respect visitors and a fair choice for a small shop that does not need advertising.
Independent check: the rule “analytics and marketing must not load before consent” was applied by a JavaScript program to the three plans, and by a separate Python expression over the same data, and the lists of violations are identical. Real sites are more complicated, with scripts that load other scripts and categories that are disputed, so a real check opens the site in a browser tool and looks at what is loaded and which cookies are set before any click on the banner. Cookie and privacy rules differ by country and change, so ask a qualified person where it matters.
Check by hand with plan B: three items, and two of them have the optional categories analytics and marketing and do not wait for consent, so the violations are those two. In plan A, all optional items wait, so there are no violations, and the necessary cookie is allowed to run immediately.
Tools that promise to make any site accessible with one line of code do not replace correct content, and may cause problems of their own. Fix the page: contrast, labels, alt text, structure and keyboard use.
Open the site in a fresh private window, do not click anything, and look at the network and cookie tools of the browser. Whatever loads before your first choice is what the banner failed to block.
Builders, plans and prices change often, so the lessons use generic labels such as Builder A and describe categories of tools, and you must check each vendor’s current website for features, prices and limits. Every calculation and check in this lesson was run while the course was written, in Python 3.13 or Node.js 22, on sample data that the lesson provides, with a second independent calculation. This is not legal advice. Accessibility and privacy rules differ by country and change, so check the rules for your location and customers.
Practice
Check the colours of three text styles in your builder with a contrast checker. List every third-party script on your site and give each a category. Fix one accessibility issue in your builder and run the check again.
Check what you learned
Five quick questions. Pick an answer and you will see straight away whether it is right and why.
What contrast ratio do normal text and background need at level AA?
- At least 1.5 to 1
- At least 4.5 to 1
- At least 10 to 1
- None
3 to 1 for large text.
What alt text should a decorative image have?
- An empty alt attribute
- The file name
- A long description
- No attribute
alt=”” makes screen readers skip it.
Which scripts usually need consent in many places?
- Analytics and marketing scripts
- The shopping basket cookie
- The page layout
- The fonts of your own server
Rules differ by country.
What does plan B do wrong?
- Uses a banner
- Has no cookies
- Uses HTTPS
- Loads optional scripts before consent
A snippet pasted into the header.
Why run each audit in two languages?
- To make it longer
- To change the page
- It is required
- To catch mistakes in either implementation
Independent agreement.
Summary
- Contrast, alt text, labels and link names are the basic accessibility checks.
- Fix them in the builder’s fields, and test with a keyboard.
- Classify scripts by cookie category and block optional ones until consent.
- Test the banner in a private window.
Questions
Is an accessibility overlay enough?
No. Overlays do not replace accessible design and content, and can interfere with assistive technology. Fix the underlying page.
Do I need a cookie banner?
If you use optional cookies or trackers, many places require consent. A site with only necessary cookies may not need one. Check the rules that apply to you.
Where do I find the rules?
In the guidance of your country's data protection authority and the Web Content Accessibility Guidelines. Check the current versions.
