My current code is:
#header { background-image: url('{{ sitePath }}/assets/toxicomental/header.png'); height: 150px; }
Still, I don't get the image showing.
What do I do wrong?
There is a function called alias
that returns a defined alias. A default alias is @web
and it represents your base url,
background-image: {{ alias('@web') }}/path/to/image.jpg;
Would display the file image.jpg
in web/path/to/
web
directory. Assets in your template folder are not public. You can as well remove the url
function. Just do as I explained
Commented
Sep 1, 2018 at 16:28
You don't need the domain part at all. Why not use
background-image: /path/to/image.jpg;