簡體   English   中英

播放中的靜態html頁面資源2.2.1

[英]Resources of static html page in play 2.2.1

我創造了

播放2.2.1項目中的靜態html頁面。

我的公用文件夾如下所示: 在此處輸入圖片說明

這些是我的樣式表鏈接:

<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/font-awesome/css/font-awesome.css">
<link rel="stylesheet" href="assets/css/social-icons.css">
<link rel="stylesheet" href="assets/css/coming-soon-style.css">

但是,當我打開站點時,我只會得到html。

感謝您的回答!

更新

我的路線:

GET  /   controllers.Assets.at(path="/public", file="comingSoon.html")
GET  /coming-soon_followUpPage.html   controllers.Assets.at(path="/public", file="coming-soon_followUpPage.html")

/public/assets/目錄中的所有文件/文件夾移到更高一級,因此,對於一個實例/public/assets/bootstrap它應該是/public/bootstrap

如我所見,您正在使用資產的默認路由,這意味着放置在/public文件夾中的每個文件/文件夾都將與模板中的assets/fileassets/folder使用。

如果/public/assets/file.css它們保持/public/assets/file.css樣式,則只需在模板中使用正確的路徑即可,即:

<link rel="stylesheet" href="assets/assets/bootstrap/css/bootstrap.min.css">

無論如何,正如您所見,這沒有任何意義;)

嗨,您以錯誤的方式鏈接了CSS文件,您有:

<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">

使用此方法,您可以在同一級別上搜索文件夾assets但這是父級assets ,您無需引用它,則只需要:

<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">

您也可以嘗試在路徑的開頭添加/

<link rel="stylesheet" href="/assets/bootstrap/css/bootstrap.min.css">

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM