ASP.net不显示CSS

我的Index.cshtml页面看起来像这样

<html>
<head runat="server">
    <link href="~/Content/index.css" rel="stylesheet" type="text/css" />
    <asp:ContentPlaceHolder ID="HeadContent" runat="server" />
</head>
    <body>
        <h1 class="title text-center">Master/Detail</h1>
        <div class="md-container">
            <div class="col-3 master">
                <div class="master-item active-item" onclick="select(this)">Option 1</div>
                <div class="master-item" onclick="select(this)">Option 2</div>
                <div class="master-item" onclick="select(this)">Option 3</div>
                <div class="master-item" onclick="select(this)">Option 4</div>
            </div>
            <div class="col-9 detail">
                <button id="back-btn" class="hidden-md" onclick="back()">< Back</button>
                <h1 class="detail-title text-center">Option 1</h1>
            </div>
        </div>
    </body>
</html>

enter image description here

这是我的项目结构

I have tried adding @Url.Content after the <link href tag but that didn't help. The website doesen't display any CSS at all.
What am I doing wrong?

评论
  • 离别yi刻
    离别yi刻 回复

    由于某种原因,Visual Studio无法识别我创建的文件夹“ Content”。在将“ index.css”文件移至默认的“ css”文件夹并更改路径后,它开始工作。