Skip to content

Adding title attribute on <img> #330

@u451f

Description

@u451f

I cannot get adding a title attribute to the tag to work, using my example preset

presets:
  default:
    formats: [webp, original]
    attributes:
      img: 'title=""'

and calling the image that way:

{% picture default assets/images/bla.jpg --alt Some alt text that works out correclty --title A different text that shows up on hover and that I use via JS %}
I would have expected to be able to set the title attribute. Even without the preset, I thought it should work as that attribute is legit https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/img#the_title_attribute

Is that supposed to work and I'm doing it wrong? :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions