試圖了解如何將我的css鏈接到主頁索引檔案。不敢相信,我沒有得到這個作業。希望你能幫助我。所以,我創建了一個標準的mvc核心專案,在視圖和homefolder中,我創建了一個新的樣式表,名稱與index相同,Index.cshtml.css,它沒有像我在一些教程中看到的那樣被嵌套。但是它在那里,
其余的代碼是這樣的。
這是css檔案
.helloWorld {
font-family: Arial。
font-size: 60px;
font-weight: bold;
color: blue;
}
這里是Layout檔案中的頭部
<head>
<meta charset="utf-8"/span> />
<meta name="viewport" content="width=device width, initial-scale=1. 0"/span> />
<title>@ViewData["Title"] - VueDemoApp</title>
< link rel="styleheet" href="~/lib/bootstrap/dist/css/bootstrap。 min.css" />
<link rel="styleheet" href="~/css/site. css" />
<link rel="styleheet" href="~/VueDemoApp. styles.css" />
</head>
我所添加的只是VueDemoApp樣式,我在哪里做錯了?
哦,還有Index.cshtml檔案:
<div>
<h1 class="helloWorld">/span>Hello World! </h1>Hello World!
</div>
正如你所看到的,這個專案沒有什么特別之處,只是想了解如何讓css作業,我對css沒有什么問題,只是想把這個該死的東西連接起來:'D
uj5u.com熱心網友回復:
要嵌套,試著命名為Index.css,而不是Index.cshtml.css。
uj5u.com熱心網友回復:
我把css檔案移到根/css中,然后把它連接起來,現在它就能作業了!
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/307749.html
標籤:
上一篇:移除行動欄(安卓作業室
