【问题标题】:Can't get stylesheet to link properly with Django Framework (using localhost)无法让样式表与 Django 框架正确链接(使用 localhost)
【发布时间】:2017-01-07 06:52:47
【问题描述】:

我正在尝试将其链接到以下路径中的 html 文件的标题中:

main/home/templates/home/index.html

而 style.css 存在于

main/main/stylesheet/style.css

这是我在 index.html 中的链接:

<link rel="stylesheet" type="text/css" href="/main/stylesheet/style.css">

有什么问题吗?

【问题讨论】:

    标签: python html css django


    【解决方案1】:

    我想你应该去:

    <link rel="stylesheet" type="text/css" href="main/stylesheet/style.css">
    

    所以你需要一个相对路径。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-19
      相关资源
      最近更新 更多