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?

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?

WBOY
WBOYOriginal
2016-08-20 09:04:012269browse

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;

Reply content:

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn