0Pricing
Web Accessibility Academy · レッスン

aria-hiddenで装飾アイコンを隠す

装飾をアクセシビリティツリーから除外します。

「aria-hiddenで装飾アイコンを隠す」はCoddyKit上の無料Web Accessibility Academyレッスンです。 これはレッスン2/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはWeb Accessibility Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Web Accessibility Academyコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

Some Icons Say Nothing

A little flourish next to a label adds nothing for a screen reader user. Announcing it just adds noise they have to wade through. 🔇

The Word Decorative

An icon is decorative when removing it would not change what the user understands. The nearby text already carries the meaning.

Hide It From the Tree

Set aria-hidden="true" on a decorative icon to pull it out of the accessibility tree so screen readers skip it entirely.

<button>
  <svg aria-hidden="true" focusable="false">...</svg>
  Save
</button>

It Hides Children Too

One aria-hidden="true" on a wrapper hides the element and everything inside it, so you mark the container, not each path.

Empty alt Does the Same for img

If the decorative icon is an <img>, give it an empty alt instead. An empty alt tells screen readers to skip the image.

<img src="sparkle.png" alt="" />

Never Hide Visible Content

The golden rule: do not put aria-hidden on anything a sighted user relies on. You would erase real content for some people.

Never Hide Focusable Things

Putting aria-hidden on a focusable element creates a ghost: keyboard users land on a control screen readers refuse to announce.

Pair It With focusable false

For decorative inline SVGs, add focusable="false" alongside aria-hidden so no browser sneaks it into the tab order.

<svg aria-hidden="true" focusable="false">
  <path d="..." />
</svg>

Redundant Icons Are Decorative

A trash icon beside the word Delete is redundant. Hide the icon and let the visible text do the talking for everyone.

Watch for the Lone Icon

Careful: an icon with no nearby text is usually not decorative. Hiding it would leave the control silent and unnamed.

Confirm It Is Gone

In the accessibility inspector, a properly hidden icon simply vanishes from the tree. That empty spot is exactly what you want.

Quick Check

A checkmark icon sits right next to the visible word Complete. What should you do with the icon?

Recap: Hide the Noise

Decorative icons get aria-hidden="true" (or empty alt) and focusable false, never on focusable or unique content. Less noise, clearer pages. 🎯

よくある質問

「aria-hiddenで装飾アイコンを隠す」レッスンは無料ですか?

はい。「aria-hiddenで装飾アイコンを隠す」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Web Accessibility Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Web Accessibility Academyコースには全4レッスンが含まれています。

「aria-hiddenで装飾アイコンを隠す」で何を学びますか?

装飾をアクセシビリティツリーから除外します。 ブラウザで直接実行するハンズオンコードでWeb Accessibility Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Web Accessibility Academyを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのWeb Accessibility Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン2/4です。

「aria-hiddenで装飾アイコンを隠す」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このWeb Accessibility Academyレッスンでコードを書いて実行できますか?

はい。すべてのWeb Accessibility Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. インラインSVG:role imgとtitle
  2. aria-hiddenで装飾アイコンを隠す
  3. 名前のあるアイコンボタン
  4. アイコンフォントのアクセシビリティ上の落とし穴
← Web Accessibility Academyに戻る