Home > Article > Backend Development > Regarding the back-end rendering data (picture path) to the inline style: background-image, the problem that the picture cannot be seen on the mobile phone?
The list display page, the template is a php template, and the image data is looped out from the background; the data is rendered into the style of the dom element of the page; the code is as follows:
<code><div style="background-image:url('public/upload/<?php echo $value['imagepath'].'?'.time(); ?>)" class="photo1" > </div> </code>
It is normal to browse on the PC; but the pictures are not displayed on the mobile phone. What is the problem?
PS: If you don’t use the data printed by the backend, but give a known image path; it can be displayed on the mobile phone;
The list display page, the template is a php template, and the image data is looped out from the background; the data is rendered into the style of the dom element of the page; the code is as follows:
<code><div style="background-image:url('public/upload/<?php echo $value['imagepath'].'?'.time(); ?>)" class="photo1" > </div> </code>
It is normal to browse on the PC; but the pictures are not displayed on the mobile phone. What is the problem?
PS: If you don’t use the data printed by the backend, but give a known image path; it can be displayed on the mobile phone;
That means the address of the picture you dynamically added is wrong, so it cannot be displayed