So I am new to ASP.NET MVC 4 (well, I used 3 a little).
Anyway, in my BundleConfig.cs file, I am trying to load the Twitter Bootstrap css files and an additional site.css
file.
But only the site.css file is rendered. I have confirmed that the bootstrap css files are indeed in the right place (Content folder) and are in the same location as the site.css
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.min.css",
"~/Content/bootstrap-responsive.min.css",
"~/Content/site.css"));
EDIT
OK, this isn't my preferred way but Andrei Drynov recommended I try:
@import url("bootstrap.min.css")
body{background: #e8e6da;padding-top:60px;padding-bottom:40px;}
@import url("bootstrap-responsive.min.css")
But that doesn't work. I changed the site.css to the above but now the background body color doesn't even work. If I remove the @imports the background is the correct color.
EDIT 2
I don't get it but adding:
bundles.IgnoreList.Clear();
To my bundles file fixed it. Hmmm. Not sure I understand. But I was able to remove the @imports out of the site.css.
Strange.
question from:
https://stackoverflow.com/questions/12533591/why-are-my-style-bundles-not-rendering-correctly-in-asp-net-mvc-4 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…