Home > Backend Development > PHP Tutorial > 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
Release: 2016-08-20 09:04:01
Original
2312 people have browsed it

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>
Copy after login
Copy after login

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>
Copy after login
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template