How to use different CSS files for each view

0

I wonder if it's possible to be using "auxiliary" CSS files.

For example, in my ASP.NET MVC 5 project, as everyone knows, and default to BootStrap , but how would I create a separate .css file for some views I've been creating?

Or, if, necessarily all css programming has to be within BootStrap.css

    
asked by anonymous 26.10.2016 / 13:13

1 answer

1

By what I understood of your need, you could create a section and in the views that were needed, point the necessary css.

For example, have in your Layout @RenderSection("css", required: false) . And in the views that implement your layout and use

@section css { <link rel="stylesheet" href="~/caminho/para/css" /> }

It's worth remembering that the Layout file is a cshtml, so depending on need you can implement simple logic (although I do not think it's a good idea).

    
26.10.2016 / 13:24