W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > October to December 2017

Re: [whatwg] Allow alt attribute with the span element

From: ashraf aleem <ashraf.aleem@gmail.com>
Date: Fri, 6 Oct 2017 16:27:17 -0500
Message-ID: <CAFU2_y0Ogn+gc1OGe1_gcaM7H86qCGhEfAe92ZznEyRjTdgNHQ@mail.gmail.com>
To: tink@tink.uk
Cc: "Michael A. Peters" <mpeters@domblogger.net>, Jonathan Garbee <jonathan@garbee.me>, WAI Interest Group <w3c-wai-ig@w3.org>
Hi,
    I use an <img> tag with "src=" as 1x1 px transparent png and alt text
followed by a span with aria-hidden="true" which has visually shown
content  and that way i can have proper <img> tag with alt text.


<img
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="
alt="clockwise rightwards and leftwards open circle arrows with circled one
overlay" /><span aria-hidden="true">&#x1F502</span>

https://jsfiddle.net/aamohamm/zLwsL2qt/

Thank you,
Ashraf Mohammad

On Fri, Oct 6, 2017 at 11:26 AM, Léonie Watson <tink@tink.uk> wrote:

>
> On 06/10/2017 12:06, Michael A. Peters wrote:
>
>> On 10/06/2017 08:44 AM, Léonie Watson wrote:
>>
>>>
>>> On 06/10/2017 11:26, Michael A. Peters wrote:
>>>
>>>> Nope, no problem at all. That looks like a simple solution I did not
>>>> find. Thank you.
>>>>
>>>
>>> Note that you need to provide an explicit role on the span if you use
>>> aria-label to provide its accessible name.
>>>
>>
>> I assume if I instead put the aria-label on the button rather than span
>> that contains the pictograph, that would work too without needing a role
>> since it is an actual button.
>>
>
> Yes, that will work.
>
>
>
>>
> --
> @LeonieWatson @tink@toot.cafe tink.uk carpe diem
>
>
Received on Friday, 6 October 2017 21:28:00 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 6 December 2017 16:04:47 UTC