我已經將css樣式表應用到了我的視圖,並且在我查看它時沒有渲染。有什麼問題就在這裏:CSS @ Styles.Render沒有渲染樣式表
編輯:在Firefox 17部作品,不IE10工作(?是與我的兼容性視圖不知道如何解決)
站長:
@using System.Web.Optimization
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>User_Master</title>
@Styles.Render("~/Content/Styles.css")
</head>
<body>
<header>
<p>header</p>
</header>
<nav>
@Html.Partial("~/Views/Shared/User_Nav.cshtml")
</nav>
<section>
@RenderBody()
</section>
</body>
</html>
Styles.css中
header {
border-color: #0094ff;
border-bottom-right-radius:10px;
border-top:hidden;
border-left:hidden;
border-bottom:solid;
border-right:solid;
box-shadow:2px 2px;
}
首頁
@{
ViewBag.Title = "Home";
Layout = "~/Views/Shared/User_Master.cshtml";
}
<h2>Home</h2>
您在'@ Styles.Render(〜/ Content/Styles.css「)中缺少一個雙引號';我不確定這只是您的問題中的拼寫錯誤,或者它是您的實際問題 – vee
Nah,在問題中輸入錯誤 – Neeta