I have a razor master layout _Master.cshtml and I include Master.css in it.
I also have a Home.cshtml and _Master.cshtml is it’s layout.
In home I have a view Event.cshtml – this view does not have any master page setup.
@{
Layout = null;
}
<style>
.boxStyle{...}
</style>
<div class="boxStyle">
...
</div>
This works. But I want to move .boxStyle to the Master.css
And when I move it there it doesn’t work anymore.
But if I add bellow code to _Master.cshtml then works. But I need it in css file.
<style>
.boxStyle{...}
</style>
What am I doing wrong here?
If you move the css from the
Event.cshtmlto theMaster.cssyou have to place a link tag in theEvent.cshtmllike that.Of course you need to add to the Event.cshtml also the basic html tags