Page 1 of 1

Is this how it should be? <picture> tag

Posted: Fri Jun 12, 2020 2:51 pm
by Smart771977
Good afternoon, I encountered an error with the picture tag.
When using the picture tag, the Web Builder generates this code. However, in all browsers, the image is replaced by an empty square.

<picture id="wb_Picture1">
<source media="(max-width:767px)" srcset="images_wb/2service1200.jpg,images_wb/2service320.jpg">
<source media="(max-width:1359px)" srcset="images_wb/2service1200.jpg,images_wb/2service320.jpg,images_wb/2service768.jpg">
<img src="images_wb/2service1200.jpg" id="Picture1" alt="" srcset="images_wb/2service1200.jpg,images_wb/2service320.jpg,images_wb/2service768.jpg">
/picture>


But if you fix the generated code, everything is OK. You just need to insert a space after the image instructions example


<picture id="wb_Picture1">
<source media="(max-width:767px)" srcset="images_wb/2service1200.jpg, images_wb/2service320.jpg">
<source media="(max-width:1359px)" srcset="images_wb/2service1200.jpg, images_wb/2service320.jpg, images_wb/2service768.jpg">
<img src="images_wb/2service1200.jpg" id="Picture1" alt="" srcset="images_wb/2service1200.jpg,images_wb/2service320.jpg, images_wb/2service768.jpg">
/picture>

(Just inserted a space)


This is only my bug or everyone's. WebBuilder ver 15, Last version, (lang RU/ENG)

Re: Is this how it should be? <picture> tag

Posted: Fri Jun 12, 2020 3:16 pm
by alan_sh
Where did you put the space character?

Alan

Re: Is this how it should be? <picture> tag

Posted: Fri Jun 12, 2020 3:24 pm
by Smart771977
before
<source media="(max-width:767px)" srcset="images_wb/2service1200.jpg,images_wb/2service320.jpg">

after
<source media="(max-width:767px)" srcset="images_wb/2service1200.jpg, images_wb/2service320.jpg">

Re: Is this how it should be? <picture> tag

Posted: Fri Jun 12, 2020 4:56 pm
by Smart771977

Re: Is this how it should be? <picture> tag

Posted: Fri Jun 12, 2020 5:15 pm
by Pablo
Thanks, I will investigate this after the weekend.

Note however that it looks like you did not use the correct file names as described here:
https://wysiwygwebbuilder.com/picture.html

Also, note that I do not recommend to start an filename with a number.
https://www.wysiwygwebbuilder.com/forum ... f=10&t=131

Re: Is this how it should be? <picture> tag

Posted: Fri Jun 12, 2020 6:49 pm
by Smart771977
Thank you so much for paying attention. First I tested with these file names pic@1.5x.png and pic@2.0x.png, but the result was the same. Therefore, I switched to a simple file name format, because I decided that it was not important.