Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML semantics and .sr-only: proposal to rewrite examples #271

Open
notabene opened this issue Jan 13, 2022 · 0 comments
Open

HTML semantics and .sr-only: proposal to rewrite examples #271

notabene opened this issue Jan 13, 2022 · 0 comments
Assignees

Comments

@notabene
Copy link
Contributor

notabene commented Jan 13, 2022

Hi,

at Affichage et vocalisation des prix this code is provided:

<p class="example" aria-hidden="true">
à partir de
<span class="price">
120<sup>,90€</sup><sub>/mois</sub>
</span>
<p>
<span class="sr-only">à partir de 120,90€ par mois</span>

Several problems arise:

  1. The semantics of sup and sub are wrong, these tags must be used for indicia, not for formatting. (These elements must be used only to mark up typographical conventions with specific meanings, not for typographical presentation for presentation's sake.)
  2. Doubling content will not be properly understood in any case when CSS is disabled or not loaded.

Suggestion:

<p class="example"> <!-- aria-hidden="true" removed -->
à partir de
<span class="price">
120<span class="cents">,90€</span><span class="sr-only">par </span><span class="payment-cycle">/mois</span>
</span>
</p>

(The “/” in “/mois” can be left, I think, as it will not be read by screen readers and will only be seen as a small glitch in the case when CSS does not load properly. YMMV though 😉 )


Same goes here:

<p aria-hidden="true">
    <strong>à partir de </strong><span class="price">1€*</span>
    <s>129,90€</s><br>
    *voir conditions
</p>
<span class="sr-only">à partir de 1€ au lieu de 129,90€ voir conditions</span>

That could be

<p>
    <strong>à partir de </strong><span class="price">1€*</span>
    <span class="sr-only">au lieu de</span>
    <s>129,90€</s><br>
    *voir conditions
</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants