惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
爱范儿
爱范儿
Martin Fowler
Martin Fowler
T
The Blog of Author Tim Ferriss
B
Blog RSS Feed
博客园 - 聂微东
G
GRAHAM CLULEY
Engineering at Meta
Engineering at Meta
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
WordPress大学
WordPress大学
Scott Helme
Scott Helme
AI
AI
S
Security Affairs
T
Threat Research - Cisco Blogs
M
MIT News - Artificial intelligence
T
Troy Hunt's Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
人人都是产品经理
人人都是产品经理
AWS News Blog
AWS News Blog
T
Threatpost
Cyberwarzone
Cyberwarzone
www.infosecurity-magazine.com
www.infosecurity-magazine.com
U
Unit 42
V
Vulnerabilities – Threatpost
J
Java Code Geeks
博客园 - Franky
月光博客
月光博客
Blog — PlanetScale
Blog — PlanetScale
NISL@THU
NISL@THU
D
Docker
小众软件
小众软件
N
News and Events Feed by Topic
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
A
Arctic Wolf
D
DataBreaches.Net
云风的 BLOG
云风的 BLOG
Forbes - Security
Forbes - Security
量子位
PCI Perspectives
PCI Perspectives
美团技术团队
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
I
InfoQ
Security Archives - TechRepublic
Security Archives - TechRepublic
有赞技术团队
有赞技术团队
腾讯CDC
P
Proofpoint News Feed
S
Security @ Cisco Blogs
G
Google Developers Blog
C
Cisco Blogs

Sanity.io

A Board Game agent built using Sanity Context and Vercel's AI SDK | Sanity Build a prototype with Claude Code that your whole team can edit | Sanity What’s New - May 2026 | Sanity I built a London pub guide with v0 and the Sanity MCP in six hours. Here's what I learned. | Sanity Build a conference concierge with Agent Context and Anthropic | Sanity Build a content-aware Telegram agent with Vercel AI SDK and Chat SDK | Sanity How I used Agent API to generate photos for my family’s recipes | Sanity What’s New April - 2026 | Sanity Better context, better matches: An AI love story (for dogs) | Sanity How to write for an agent | Sanity Content Agent, meet Slack: AI content operations in your workflow | Sanity Structure powers intelligence | Sanity Your agent needs better content. Here's how to give it. | Sanity How to serve content to agents (a field guide) | Sanity Sanity TypeGen GA: Automatic TypeScript types for content and GROQ | Sanity Sanity is now available on the Vercel Marketplace | Sanity The logo soup problem (and how to solve it) | Sanity Content Releases: From scattered updates to coordinated publishing | Sanity What's New - February 2026 | Sanity How we solved the agent memory problem | Sanity v0 Builder Challenge: The winners | Sanity Introducing: Sanity Agent Skills | Sanity Content Agent: Days of work in one conversation | Sanity Our Sanity Values | Sanity Open Source Pledge 2025: Stepping up when it matters | Sanity v0 builder challenge: $3000 in prizes | Sanity Why AI Breaks Without Structured Content Operations | Sanity What’s New January - 2026 | Sanity BFCM 2025: What teams built when infrastructure stopped being the problem | Sanity How AI shaped holiday shopping and what it means for content in 2026 | Sanity Sanity Studio v5: Embracing React 19 | Sanity You’ll need a CMS eventually. Let your agent set it up. | Sanity “You should never build a CMS” | Sanity AI Content Operations: A 30-Day Implementation Guide | Sanity What’s New December - 2025 | Sanity Scheduled Drafts: Stop manually publishing content at midnight | Sanity What’s New November - 2025 | Sanity Everything *[NYC] 2025 recap: A day of AI, Content Operations, and Culture | Sanity Clankers and content operations | Sanity Content Agent: AI that understands your structured content is here | Sanity Why design-driven content modeling creates technical debt, not velocity | Sanity What's New October - 2025 | Sanity From studio to inbox: How Kevin Green eliminated email campaign friction | Sanity The content editor's guide to content operations [E-commerce edition] | Sanity styled-components maintenance mode: A 40% faster fork | Sanity From zero code to a live website in 7 hours (thanks, Cursor!) | Sanity First attempt will be 95% garbage: A staff engineer's 6-week journey with Claude Code | Sanity Internationalization is more than translating words | Sanity What's New - September 2025 | Sanity We just deleted our 35k-member community Slack | Sanity What's New - August 2025 | Sanity The engineer's guide to content operations [E-commerce edition] | Sanity SEO for AI: Evolving from Web Pages to the Content Lake | Sanity What's New - July 2025 | Sanity Sanity Studio v4: A major version bump for a minor reason | Sanity What's New - June 2025 | Sanity Dashboard and Insights: Your New Content HQ | Sanity Canvas: AI-accelerated, context-aware, freeform authoring | Sanity Agent Actions: AI building blocks for structured content | Sanity Functions: Life beyond pressing publish | Sanity A new era for content applications with Sanity App SDK | Sanity The end of CMS era and our $85M Series C. | Sanity What's New – May 2025 | Sanity Introducing the Sanity Model Context Protocol (MCP) server | Sanity What's New – April 2025 | Sanity Pushing all the envelopes with ambitious content | Sanity Self-hosting is only free if your time is worth nothing | Sanity Content that lasts: Scaling beyond your frontend | Sanity The Live Content API is now Generally Available | Sanity The future beyond AI chat bots | Sanity Learning the new skill of working with AI | Sanity What's New - March 2025 | Sanity Give it in plain text: Making your content AI-Ready | Sanity No More 'DO NOT PUBLISH': Introducing Content Releases | Sanity React in 2025, what's next? | Sanity The final boss of front-end: block editors | Sanity Introducing Sanity for Startups | Sanity A block content editor that loves you back | Sanity A Black Friday Snooze Fest: Massive Traffic, No Drama | Sanity How to make a recipe site that scales well | Sanity The Sanity Winter Release 2024 | Sanity AVIF Arrives, Sanity’s Promise Fulfilled | Sanity Sanity joins the Open Source Pledge | Sanity Your content is now Live by default | Sanity Begin Team to Join Sanity | Sanity Sanity Digest - September '24 Edition | Sanity Sanity partners with Google. Now live on the Google Cloud Marketplace. | Sanity Sanity Digest - August ‘24 Edition | Sanity Now playing: the latest Mux Video Input plugin for Sanity | Sanity Community Digest - June ‘24 Edition | Sanity Community Digest - May ‘24 Edition | Sanity Guide to Sanity's newest product announcements | Sanity AI and Content Creation: A Leader's Guide | Sanity Of course, you should be able to type your content quickly! | Sanity New to AI Assist: translation, reference suggestions, image generation | Sanity Speak the language of your editors: Sanity Studio UI localization | Sanity Introducing the new Sanity Growth plan to serve collaborative teams | Sanity Presentation: Work faster than ever with structured content | Sanity Goodbye Feedback Frenzy, Hello Sanity Studio Comments! | Sanity Easing into the App Router with the Sanity Toolkit for Next.js | Sanity
6 Ways HTML Impacts Your Page’s Accessibility | Sanity
Hidde de Vries · 2022-07-19 · via Sanity.io

We all want our websites and apps to be accessible. Did you know that as a front-end developer, a lot of the work you can do is actually in being aware and intentional when writing HTML?

Here are some tips you can apply right away, taken from a talk I gave at JSConf Budapest.

What is web accessibility?

Before we go into the details, let’s look at what web accessibility actually means. Web accessibility is the practice of ensuring that people with disabilities can use your website or app. And ensuring that they can buy your products or use your services.

This concerns a lot of people: roughly 15% of the world’s population have a disability.

A motor impairment might mean someone can’t use a mouse to press ‘Next,’ a neurological condition might mean they have short term memory loss, color deficiencies might mean they don’t see the difference between green and red, and hearing loss might mean they use the transcript to follow along with your podcast. Often, there is overlap and gradations in these disabilities.

Some people will use specific tools and techniques to access the web, like voice control, switch controls, braille displays, and screenreaders (see also: How people with disabilities use the web). As web developers, we can ensure compatibility.

In today’s post, we will mostly focus on optimizations that are specific to people who use screenreaders, because that’s an area where front-end developers and markup can make a large impact. Other parts of accessibility will probably be ensured by other team members, like designers and content editors.

How browsers process markup: from DOM to end users

When you visit a website, the browser requests the website and the server will respond with a blob of markup: HTML. The browser then turns that into a DOM tree, an abstract and real-time representation of what was in your markup.Your headings, links, buttons, lists: they’re all there.

After that tree is constructed, it can change at any time. You might add a classname here and there or render a full-fledged React app.

In certain cases, the browser will create another tree: the accessibility tree. This tree is based on the DOM tree, but it contains all the accessibility-relevant information, like “roles”, “names” and “states”. This information answers questions like “what kind of thing is this?” (is it a text input, a button, a link?) and “how should we refer to it” (is it named ”Save my changes”, “International news” or “First name”?).

The accessibility tree also has meta-information like “is this thing expanded” or “is this checked”, for a checkbox.

The accessibility tree has all this information, and passes it on to Accessibility APIs that are built in to all the major platforms (Windows, Mac, Linux, etc). Those APIs communicate with screenreaders and others tools. This is how a screenreader knows to say “here’s a checkbox called ‘Save my changes’ that is checked”.

Long story short, your markup has a significant impact on how end users understand a page. It communicates what everything is on the page, how to refer to it and more.

Should you want to look at the accessibility tree of your page, you can inspect it in all modern browsers. In Chromium-based browsers, some of the accessibility tree data (name, role) is also available in the tooltips you see when you hover over elements with Developer Tools.

The practical effects of our markup

To understand what this means in practice, let’s look at some markup examples. Whether you use Astro, Ember, Eleventy or Vue, all of them will ultimately end up as HTML in browsers, with DOM and accessibility trees based on them.

Titles

The <title> element is likely on your pages, but it’s usually hidden away in some template that you don’t open daily. It is essential, though, for users of screenreaders.

When a page loads, most screenreaders will read out the contents of the <title> element. This gives people a quick heads up about the page they’ve ended up on.

Ideally, the unique part goes first: all pages on Sanity’s website probably have the word Sanity in their title, but if I open the page about Sanity Studio and the one about Content Lake, I want to hear that first, not that they both relate to Sanity.

Headings

The headings (h1, h2, h3 etc) on your page are like tables of contents, especially for users of screenreaders. Via the H key (NVDA) or the Rotor‘s list of headings (VoiceOver), users can access just the headings in a page, and then choose to jump to the one they want.

This is a common way to navigate, and for us, it means that what we put into our heading tags matters, because it will be used for navigation.It’s a little bit like when you call a customer service number and the recording says, “Press 1 for Sales, press 2 for Support”, but with your page’s headings as the options.

Landmarks

With landmarks (elements like header, footer, nav, aside, main), you can identify what the most important sections of a given web page are. Technically, that means wrapping the area of your page in that element, and ideally using aria-label or aria-labelledby to give them a name.

One way to think about what HTML landmarks do on a page is to compare them to a physical space. In a theatre venue, landmarks may be the main auditorium, the toilets, the wardrobe and the bar. They are the things visitors would ask you about, and they are the things you would probably decide to add some signage for.

But you don’t want to go overboard – each of the individual seats, toilets, hangers or wine bottles aren’t landmarks, if there are too many it is no longer useful. That’s the same with landmarks in a web page: yes, mark a header, footer, a couple of navs, but don’t mark each individual product if you have a long list of them (see Accessible landmarks for more tips).

Form controls

There is a lot to say about form controls, but today we will focus on labelling them. When WebAIM, a US-based non-profit, looked at the top 1 million websites, they found that almost half of them had unlabelled form inputs.

Basically, any input field, radio button, checkbox, select and text area needs to be labelled, as that is what gives them an accessible name in the accessibility tree.

The Accessible Name and Description Computation has the full details on how browsers calculate names for form fields, but the easiest ways to add a label are by using the label element (that way, you can also make them visible for sighted users) or applying an aria-label attribute to the input directly. You can find out if it worked in the browser’s accessibility tree.

Tables

You may have heard tables aren’t good for accessibility, but that’s mostly when they are used for page layout. Tables that are used for tabular data can actually be great for accessibility.

Screenreaders have some ergonomics built in to work with tables. They will work out of the box with tables, but only if they are well marked up.

First, you will want to make sure your table has a caption to name it, especially if you have multiple, so that people can distinguish them, just like they can distinguish pages with title elements and page sections with headings. For instance, if you have financial results of three years in three separate tables, you’ll want their captions to clearly mark which one is which.

Second, it’s helpful to useth elements to mark which cells are headings, with scope attributes that specify whether they apply to a column (scope=column) or row (scope=row).

Buttons

We looked at form elements earlier, but the button element deserves a special mention.

This element is great, because it comes with a lot of stuff built in: you can find it when you use TAB to go through a page, users can press it with just a keyboard and they can submit forms, even if JS fails. It has been popular for a while to build buttons out of div elements, but that is not advisable, as you would need to recreate a lot of functionality that the browser provides for buttons from scratch.

One thing to note when building buttons is if they have only an icon in them, eg no text. This is common, especially in more complex UIs. That way, if they show up in the accessibility tree, there is no text to derive the accessible name from.

You can fix that by adding visually hidden text or using the aria-label attribute on the button.

It’s the markup that matters

In this post, we saw we can improve a lot of our page’s accessibility right in our markup.

Good markup indicates what’s what on a page, it helps assistive technologies that parse the page on behalf of our users. Good content within our markup is equally important: a clear “name” makes a link, heading, or table easier to find – for all users.