你的css文件目录结构:

MVC引用CSS文件の正确姿势

 

将路径写入BundleConfig规则中:

 1 using System.Web;
 2 using System.Web.Optimization;
 3 
 4 namespace XXXX
 5 {
 6     public class BundleConfig
 7     {
 8         public static void RegisterBundles(BundleCollection bundles)
 9         {
10             bundles.Add(new StyleBundle("~/Content/cssSelf").Include(
11                 "~/Content/css/bootstrap.css",
12                 "~/Content/css/etalage.css",
13                 "~/Content/css/flexslider.css",
14                 "~/Content/css/megamenu.css",
15                 "~/Content/css/style.css"
16                 ));
17         }
18     }
19 }
View Code

相关文章:

  • 2022-12-23
  • 2021-07-26
  • 2021-08-22
  • 2021-11-17
  • 2021-10-28
  • 2021-12-13
猜你喜欢
  • 2022-12-23
  • 2021-12-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-20
  • 2021-08-21
相关资源
相似解决方案