我试图将静态图像的位置传递给jumbotron div标记的style属性中包含的背景图像的url()属性。你知道吗
我尝试了以下几种不同的方法:
这是在我的公园里_详细信息.html你知道吗
{% extends 'full_base.html' %}
{% load tags %}
{% load static %}
{% block main_content %}
<div class = "jumbotron" style ="background-image:linear-gradient(rgba(255,255,255,.6), rgba(255,255,255,.6)), url({% static {{park.imageloc}} %});background-size:100%;background-position:left center; background-repeat:no-repeat">
此尝试返回错误:
TemplateSyntaxError at /waittimes/park/2/
Could not parse the remainder: '{{park.imageloc}}' from '{{park.imageloc}}'
我也试图以此作为底线:
<div class = "jumbotron" style ="background-image:linear-gradient(rgba(255,255,255,.6), rgba(255,255,255,.6)), url({% static '{{park.imageloc}}' %});background-size:100%;background-position:left center; background-repeat:no-repeat">
在以下位置找不到图像:
/static/%7B%7Bpark.imageloc%7D%7D
提前谢谢
尝试:
例如:
相关问题 更多 >
编程相关推荐