Translate “srcset” attribute inside picture element
-
I use the
<picture>
element to make my homepage main banner responsive to the screen size. When the user is using mobile, a narrow version of the banner is loaded. When the user uses desktop, a wide version is loaded. Those banners have text on them, so the images need to be translated.Example below:
<picture> <source srcset="banner-wide.png" media="(min-width: 600px)"> <img src="banner-narrow.png" alt="MDN"> </picture>
The problem is that I am unable to translate the
<source>
element (give a different image to thesrcset
attribute). I can only translate the<img>
element. How can I solve this issue?The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Translate “srcset” attribute inside picture element’ is closed to new replies.