[英]Local Flask - HTML Project Link to CSS and JS not Linking when run
我已經開始通過創建 web 應用程序來完成我的 CS50 最終項目。 我開始在本地系統上為我的 html/css/javascript 文件制作所有基本布局,並在本地安裝 flask 進行試用。 Although when I directly open the html files, it is linked up to the css and jaascript files, when I run it in flask, it gives me the error of "404 not found" for all of the css and javascript files I am trying to適用於 html。
這是我的 html 文件中的代碼:
<link rel="stylesheet" type="text/css" href="../styles/page_layout.css">
<link rel="stylesheet" type="text/css" href="../styles/navbars.css">
<link rel="stylesheet" type="text/css" href="../styles/styles.css">
html 文件位於模板文件夾中,我有一個單獨的相鄰文件夾,用於 css 文件和“javascript”用於 js 文件。 我嘗試了各種格式,但無法讓它工作。 有誰知道這可能是為什么? 謝謝。
我已經找到了適當的語法,可以按照我的意願將我的 web 應用程序轉換為 function。
我在這里找到的答案: CSS Problems with Flask Web App
我使用了提供的語法,不再遇到任何問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.