我正在开发一个 asp.net mvc 应用程序 index.cshtml 是我的默认页面,当我运行该应用程序时,此启动页面运行时应用了 css,但是当我从 Controller “/home/index”访问此页面时,css 不是工作是什么原因?
最佳答案
尝试在 css 路径中使用“/”作为前缀。它从根本上考虑。
<link rel="stylesheet" href="/css/style.css" type="text/css" />
关于html - 通过 Controller CSS 访问 View 时不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23592093/