如何在ASP.NET 5中引用自己的css文件? [英] How to reference own css file in ASP.NET 5?
问题描述
我试图加载位于
中的名为styles.css
的文件〜/ Content / css / styles.css
我试着将它添加到_Layout页面中b
$ b
< link rel =stylesheethref =〜/ Content / css / styles.css/>
这给了该位置上的404个。
我喜欢bower如何处理外部库和吞噬的方式,当我请求缩小版本时,神奇地完成了所有其他工作,比如缩小文件,但通过所有这些新功能,我无法添加自己的简单静态文件。
有人可以帮助我引用我自己的 styles.css
文件吗?
I am trying to load a file called styles.css
which is located in
~/Content/css/styles.css
What I tried is adding it to the _Layout page
<link rel="stylesheet" href="~/Content/css/styles.css" />
This gives a 404 on that location.
I like the way how bower handles external libraries and gulp magically does all the other stuff like minifying a file when I request a minified version, but through all this newness I cannot add a simple static file of my own.
Could someone be so kind to help me reference my own styles.css
file?
You can either move/copy the Content folder under www root folder or use grunt file.js to process,combine,minify, and then copy to a folder under wwwroot. But ~/ now means wwwroot
这篇关于如何在ASP.NET 5中引用自己的css文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!