首页 > 解决方案 > 如何将自定义 css 添加到 Sitecore Habitat 中自定义创建的特征模型的视图中?

问题描述

我正在尝试将自定义 css 添加到我的剃刀视图中。该路线正在工作,因为我可以看到文件中的 html,但是当我尝试添加自定义 css 时它不起作用。

我已经在我的 Overview.cshtml 中尝试了以下代码,这是我在 sitecore 中的自定义功能的视图:

<head>
    <meta name="viewport" content="width=device-width" />
    <title>Overview Rules</title>
    <link href="~/Style/ExternalProfiling.css" rel="stylesheet" />
    @RenderAssetsService.Current.RenderStyles()
</head>

两者都是栖息地解决方案中的选项,但似乎都不起作用。我的文件结构如下:

我的代码

实际结果是没有样式表链接到 cshtml 文件,因为我认为它已被覆盖。我想知道我应该将我的 css 或 sass 放在哪里,以便在功能模型中自定义创建的视图上进行样式设置。

标签: csssasssitecorehelixsitecore-habitat

解决方案


推荐阅读