Search code examples
c#css.netmodel-view-controllershared

override width from _Layout.cshtml


In my shared layout I have a width specified on my body-container div.

Is there a way to override this width in just one of my views? i want to keep using the remaining parts of the shared layout.

Thanks.


Solution

  • There are 3 solutions:

    1) put body-containers in every view.

    2) Inside view <style> .body-container {width: 1000px!important} </style>

    3) use javascript to override css.