本文档介绍区块主题如何支持无障碍访问,并简化添加无障碍功能的过程,包括地标区域、跳过内容链接和导航菜单等关键方面。
<!-- wp:group {"tagName":"header","layout":{"type":"constrained"}} -->
<header class="wp-block-group"><!-- wp:site-title /--></header>
<!-- /wp:group --><!-- wp:group {"tagName":"main","layout":{"type":"constrained"}} -->
<main class="wp-block-group"><!-- wp:heading -->
<h2 id="hello-world">Hello World</h2>
<p>Welcome to WordPress. This is your first post. </p>
<!-- /wp:heading -->Block themes support accessibility and simplify the process for adding accessibility.
Group, Template part, and Query blocks can become a landmark. There are two ways to create landmark.
Using block markup”tagName":"header” creates header landmark.
<!-- wp:group {"tagName":"header","layout":{"type":"constrained"}} -->
<header class="wp-block-group"><!-- wp:site-title /--></header>
<!-- /wp:group -->
Using site editor
HTML element under Advanced section in the Block panel provides the following landmark options.
HTML element under Advanced section in the Block panel provides the following landmark options.<header> <main> <section> <article> <aside> <footer>.
By selecting <main> landmark on Group, Template part, or Query block generates the Skip to Content link. Learn more about the skip to content link here.
<!-- wp:group {"tagName":"main","layout":{"type":"constrained"}} -->
<main class="wp-block-group"><!-- wp:heading -->
<h2 id="hello-world">Hello World</h2>
<p>Welcome to WordPress. This is your first post. </p>
<!-- /wp:heading -->
Navigation block enables the following accessibility without additional code.
<nav> landmark rolearia-label aria-hiddenChangelog: