【问题标题】:index.html file Style background img url for python Djangopython Django的index.html文件样式背景img url
【发布时间】:2020-12-06 15:38:59
【问题描述】:
style="background-image:url({% static 'images/home_slider.jpg' %})"

如果我错了,请查看上面的代码并纠正我。此代码用于在 django 中使用静态加载方法加载背景 img。

在 vs 代码中显示错误。 请帮帮我

【问题讨论】:

    标签: python html css django


    【解决方案1】:

    是的,不需要这样写,直接写吧:

    .mydiv{
      background: url('<your_image_path>');
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-05-02
      • 2017-04-01
      • 2018-07-17
      • 2020-03-28
      • 2020-03-20
      • 2013-05-04
      • 1970-01-01
      相关资源
      最近更新 更多