如何在ASP.NET 5中引用自己的css文件? [英] How to reference own css file in ASP.NET 5?

查看:115
本文介绍了如何在ASP.NET 5中引用自己的css文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图加载位于


中的名为 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆