newb for pyramid and python. I was able to successfully link my static files in any of my jinja2 templates, i.e.:
<link rel="stylesheet" type="text/css" href="{{'myproject:static/mycss.css'|static_url}}"></link>
The .css file loads fine, and I can reference any images that are inside my static folder while I do this in the jinja template.
I would like to use the image as a background, but I had problems with linking to the image in my css file:
#mydiv{ background-image:url("{{'myproject:static/myimage.gif'|static_url}}"); }
This link appears in mycss.css as
"{{'myproject:static/myimage.gif'|static_url}}"
and does not appear as a link. (if I load an external hosted image as a background image that it works)
THX!
Marissa levy
source share