I’m developing a site with cakephp that use a template from https://github.com/maiconpinto/cakephp-adminlte-theme
I have a problem when I try to set a background image from the body HTML tag
I’ve saved my picture to vendor\maiconpinto\cakephp-adminlte-theme\webroot\img
the image name file is background.png
and this is my code
print.ctp
<_style type="text/css">
body{
background-image: url('background.png')?>');
}
<?php
$this->layout = 'AdminLTE.print';
?>
<_h1>Hello World</_h1>
but the background image is failed to load
spadeX
December 28, 2019, 6:41am
2
You Need to put the image default directory webroot/img then you can use the that image.
otherwise check the image url on address bar.
1 Like
it doesn’t work, the image background still not load, did my CSS code correct?
Zuluru
December 29, 2019, 12:48am
4
url('background.png')?>'
seems like a bad value for background-image
. Shouldn’t it just be url('background.png')
?
1 Like
I have just encounter same problem and I think above answer doesn’t solve it.
If you have default paths and wrote it in css file, try:
url('../img/background.png')