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

推荐订阅源

T
Threatpost
博客园 - 叶小钗
T
The Blog of Author Tim Ferriss
Recent Announcements
Recent Announcements
D
DataBreaches.Net
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
Netflix TechBlog - Medium
Microsoft Azure Blog
Microsoft Azure Blog
Microsoft Security Blog
Microsoft Security Blog
B
Blog
U
Unit 42
有赞技术团队
有赞技术团队
博客园 - 聂微东
GbyAI
GbyAI
宝玉的分享
宝玉的分享
F
Full Disclosure
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MyScale Blog
MyScale Blog
Jina AI
Jina AI
Martin Fowler
Martin Fowler
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
D
Docker
P
Proofpoint News Feed
A
About on SuperTechFans
I
InfoQ
博客园 - 【当耐特】
C
Check Point Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy & Cybersecurity Law Blog
T
Threat Research - Cisco Blogs
Y
Y Combinator Blog
Project Zero
Project Zero
WordPress大学
WordPress大学
小众软件
小众软件
AWS News Blog
AWS News Blog
博客园 - 司徒正美
T
The Exploit Database - CXSecurity.com
L
LINUX DO - 热门话题
I
Intezer
Engineering at Meta
Engineering at Meta
C
CXSECURITY Database RSS Feed - CXSecurity.com
J
Java Code Geeks
T
Tenable Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Last Week in AI
Last Week in AI
C
CERT Recently Published Vulnerability Notes

Adrian Roselli

Focusgroup Tests ∪ of Target Audiences (Accessibility, SEO, AEO/GEO) headingoffset is Not the Document Outline Algorithm Maybe Don’t Rely on Google’s “Modern Web Guidance” WCAG3 Contrast as of April 2026 Accessibility Law of Headlines Your Browser Can Already Speak a Page Honoring Mobile OS Text Size You Know What? Just Don’t Split Words into Letters Barriers from Links with ARIA
Link + Popover Navigation
Adrian Roselli · 2026-07-09 · via Adrian Roselli

This is a redress of my 2019 post Link + Disclosure Widget Navigation, except (as the title implies), I’ve modified it to use native HTML popovers instead of ARIA or HTML disclosure widgets.

Popover has the benefit of using appropriate HTML structure and semantics while removing the need for scripting and ARIA. I use some ARIA here regardless.

popover vs. Disclosure Widgets

ARIA-based disclosure widgets (<button aria-expanded>) require script to work. HTML-based disclosure widgets (<details> / <summary>) expand when there is a hit for in-page searches (in two engines), have inconsistent exposure to accessibility APIs (across browsers and over time), and in my experience confuddle teams with styling overrides. I have a 2020 post going into some detail on each.

The popover feature requires CSS for positioning. Cross-browser anchor positioning support only came about recently. Because popovers appear on the top layer, you have to be careful with anything that uses z-index. Only use this pattern if all the dialogs on your site are already using the native HTML <dialog> element, otherwise overlapping issues happen.

The Pattern

Embedded below or visit it directly at Codepen. There’s also a debug version.

See the Pen Link + Popover Nav by Adrian Roselli (@aardrian) on CodePen.

The Container

The navigation lives in a <nav> as a list with nested lists.

<header>
  <nav id="Nav">
    <ul>
    […]
    </ul>
  </nav>
</header>

The links are links. They work with a keyboard, assistive technology knows what to do with them, and links are generally well understood by users.

I identify that the current parent page is the About page and the current page is Job Postings by using aria-current="page". I also use that as my CSS selector and you should too.

<li>
  <a href="[…]" id="Item02" aria-current="page">About</a>
  […]
  <ul id="SubItem02" popover>
    […]
    <li><a href="[…]" aria-current="page">Job Postings</a></li>
  </ul>
</li>

The Button Trigger

As my older pattern, the <button> element is the trigger. Unlike my older pattern, it doesn’t use aria-expanded.

Instead it uses popovertarget, which brings the programmatic state aria-expanded for free. The value of popovertarget must be the id of the content whose appearance you want to control (the popover content). The popover content needs the popover attribute for this to work.

No CSS or JavaScript is needed to make this content appear or disappear.

<button type="button" id="btnItem02" aria-labelledby="Item02" popovertarget="SubItem02">
  <svg […]>[…]</svg>
</button>
<ul id="SubItem02" popover>
 […]
</ul>

Naming the Button

This is the second place I still use ARIA. To avoid text duplication and auto-translation issues, I use aria-labelledby to reference the text of the preceding link. Screen reader users hear / feel a different control type and that it’s expandable, which has proven to be sufficient context. For voice users, saying the visible text presents them with the option to choose the link or the button.

<a href="[…]" id="Item02" aria-current="page">About</a>
<button type="button" id="btnItem02" aria-labelledby="Item02" popovertarget="SubItem02">
  <svg […]>[…]</svg>
</button>

Focus Order Support

You must place the popover content immediately after the popover trigger, otherwise you risk reading order and focus order problems for users. The popover feature does not automatically do any focus management.

Esc Support

It comes for free with popover.

Click-to-Close Support

It comes for free with popover.

Focusout-to-Close Support

You’ll have to write your own.

Styles

Not all of these styles will work for you, but these may matter:

  • I use logical properties throughout. The demo has buttons to let you cycle between four writing directions. They are not a perfect test since neither the rest of the page nor the text change.
  • There are no classes. IDs only exist as hooks for popover and naming references.
  • the links are block links (using CSS generated content) to fill the container. The buttons have a z-index to sit in front of them.
  • The layout uses flexbox with no width media queries. If you don’t like the wrap or the layout, write your own.
  • Supports forced-colors / Windows High Contrast Mode out of the box with no custom CSS. That’s partly because the focus styles use outlines.
  • Uses color-scheme: light dark just so I could more easily see styling gaps, but I don’t recommend that for real-life use.
  • The buttons use an arrow SVG that rotates via :popover-open when the popover appears / disappears. It honors user motion preferences.
  • The button and arrow position shift based on typeface, as with any layout mixing icons and type.
  • The popover triggers conform to 2.5.8 Target Size (Minimum), but you can always make them bigger. Make sure yours at least conform.

There is a button on the demo to remove all styles from the page, making it easier to see how this will perform as raw HTML, for easy testing, or for CSS Naked Day.

Popover Positioning

I haven’t played with popovers much. Positioning it to work across Firefox, Chromium, and Safari while also not overflowing the window or falling apart with text direction changes proved to be a challenge. I welcome suggestions on improvements.

My goal was to have the popover appear to the right edge of the parent list item and just below the button — for left-to-right languages — and in a corresponding location for other language text directions.

[popover] {
  inset: auto;
  position-anchor: auto;
  inset-block-start: anchor(self-end);
  inset-inline-end: calc(anchor(self-end) - 1em);
}

I flailed about trying different values from the spec and struggled to understand logical properties with anchor positioning. As it is, the popover positioning falls apart with the vertical writing modes, but I can’t be sure if that’s my code or browser bugs (¿Por qué no los dos?).

Pattern History

There are reasons I built this pattern.

Early in 2017 I filed an issue against ARIA Authoring Practices (APG) requesting a change to the menu navigation pattern. Despite a great deal of feedback in agreement, it continues to languish. In late 2017 I wrote Don’t Use ARIA Menu Roles for Site Nav and started actively campaigning against the APG pattern. In 2019, Sarah Higley proposed a disclosure-only APG pattern and then a disclosure and link pattern proposal in 2020.

A plate full of slightly under-baked mini popovers, or tiny Yorkshire puddings, with a web site navigation over the top and a similar vertical navigation down the left.
An under-baked batch of mini popovers I made for my solo Easter during the first year of the pandemic. I still ate them all.

HTML (via Open-UI) has since stepped in to fill some gaps, so here we are.

Wrap Up

Standard disclaimers apply: may not work for your audience, likely has bugs, support can change, new features may moot this, my design sense is poor, yes you have to write script to get whatever custom interactions you think are nifty but which probably annoy users, who even writes code anymore, using [insert random element here] in a way that’s not mentioned in this post is your problem not mine, etc.

And if you have more experience with multilingual popover anchor positioning, please share!