Hiren Kundariya
Hiren Kundariya

Reputation: 33

How to change default CSS File which is apply to the _Layout.cshtml using code in MVC 4

For eg:-In MVC Website the default css is Applyed "Site.css" and I want to Apply "MyStlyle.css" inplace of "Site.css"... How Can I change this File?

Upvotes: 3

Views: 5562

Answers (2)

user2067278
user2067278

Reputation:

Please give more specific information about your problem. More-over, you can remove the default CSS from layout page and provide the CSS on the specific page you wish (i.e. on the local page)

or you can follow this approach:

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

Upvotes: 0

AliRıza Adıyahşi
AliRıza Adıyahşi

Reputation: 15866

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 custom css in Root/Content/ folder.

Upvotes: 3

Related Questions