Skip to content

HTML for thumbnails: redundant "title"? #998

@mgeier

Description

@mgeier

I've copied the HTML generated by Sphinx Gallery for nbsphinx (spatialaudio/nbsphinx#666) in order to solve #984.

If I'm not mistaken, the new HTML is something like this:

<div class="sphx-glr-thumbcontainer" tooltip="{{ tooltip }}">
  <img alt="{{ title }}" src="{{ filename }}" />
  <p><a class="reference internal" href="{{ uri }}"><span class="std std-ref">{{ title }}</span></a></p>
  <div class="sphx-glr-thumbnail-title">{{ title }}</div>
</div>

It looks like the title appears three times.
Is that intentional?
Or am I missing something?

I think it is generally important to use good alt text for images, but in this case it seems to me that:

  • it is entirely redundant
  • the title is meant for the whole page, not necessarily for the specific thumbnail image

I'm not a user of a screen reader, but I have the feeling that the title might be spoken multiple times.

It might be good to use alt="", which means that the image is not a key part of the content and AFAIU, it will not be spoken by a screen reader.

I don't really understand the <span> element within the <a> element, why is the title included there another time?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions