Welcome Guest, Not a member yet? Register   Sign In
Allow inline style attibute on element using Content Security Policy (CSP)
#4

(This post was last modified: 09-23-2021, 08:01 AM by wdeda.)

Since it is a background image it should be contained in an external CSS file, it is not recommended to use CSS files inline:
Code:
.single-slider {
background-image: url('/assets/img/backgrounds/your_example.png');
}

usually what is stored in a database is the file identification, file name, almost always for use in a variable:

<img width="960" src="/assets/img/home/banners/<?= $data1->link ?>.jpg" height="418">

unless the path stored in the DB contains the file format, jpg, png, etc., this is not informed in the given example;
and there is a closing bracket without the corresponding opening bracket and even if it were there it would cause a coding error.

style="
background-image: url('<?= base_url('image_path']); ?>');">
Reply


Messages In This Thread
RE: Allow inline style attibute on element using Content Security Policy (CSP) - by wdeda - 09-23-2021, 04:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB