How to change the defult CSS file that is applied to _Layout.cshtml using code in MVC 4

For example: -MVC website uses default css. "Site.css" and I want to apply "MyStlyle.css" in place of "Site.css" ... How can I change this file? Thanks in Advance ...

+3


source to share


2 answers


Root> App_Start> BundleConfig.cs

Change this line:

bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));

      



to

bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/MyStlyle.css"));

      

And place your own css in the folder Root/Content/

.

+3


source


PLease gives more information about your problem. what is more, you can remove the default css from the layout page and provide the css on the page u want to use the CSS (i.e. on the local page)

or you can follow this approach:



bundles.Add(new StyleBundle("~/Content/css").Include("your css");

      

0


source







All Articles