Hi, I would like to render the <picture>
html tag in my templates and filled using dynamic data. One use of the <picture>
tag is to show different images depending on the browser size (desktop vs mobile). To do this it requires a <source>
tag and of course the <img>
tag:
<picture>`
<source media="(min-width: 800px)"
sizes="100vw"
... >
<source media="(min-width: 600px)"
...>
<img src="..."/>
</picture>
I looked at Phoenix.HTML.Tag
macro but this only seems to be able to render attributes for one tag only, such as img
. Is there a way to add all the children <source>
and <img>
using this macro, or another macro that can do this?
Thanks.