gpt4 book ai didi

html - 为什么 App Engine 不加载我的样式表?

转载 作者:太空宇宙 更新时间:2023-11-04 03:33:15 24 4
gpt4 key购买 nike

我在 html 上用这一行导入我的样式表

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

当我将文件拖放到浏览器中时它工作正常但是当我通过 AppEngine 加载时它不获取 css 文件或位于子文件中的图片

最佳答案

你能展示你的 app.yaml 和你的文件夹结构吗?是 Python、Java、PHP 还是 Go?

如果是 python,你应该为你的静态文件使用一个文件夹,在你的 app.yaml 文件中为这个文件夹添加一个处理程序:

handlers:
- url: /static
static_dir: static

然后将其链接为:

<link href="/static/styles.css" rel="stylesheet" type="text/css" />

有关更多信息,请查看 https://developers.google.com/appengine/docs/python/gettingstartedpython27/staticfiles

关于html - 为什么 App Engine 不加载我的样式表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25998138/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com