Skip to content Skip to sidebar Skip to footer

Asp Mvc Default Application Generated Remove White Spaces

So when a mvc project is genereted it has his default master page and partial views like the register and login views.The problem is that the master page is genereted with default

Solution 1:

The whitespace is there because, by default, an ASP.NET MVC project created through Visual Studio uses the Bootstrap CSS Framework. I recommend you learn to use it - it will make your front-end development magnitudes easier.

Addressing your question, you'll find that the content with the "whitespace" either side is nested in a div which has the class container. Removing this class and using container-fluid will remove the whitespace and make the container full-screen-width instead.

Don't try to override the margin set on containers by Bootstrap, you'll ruin Bootstrap's styling elsewhere.

Solution 2:

Or in your

_layout.cshtml

you just replace this tag

<div class="container body-content">

by this one:

 <div class="container-fluid body-content">

Solution 3:

You should change max-width in body content Site.css

.body-content {
    padding-left: 15px;
    padding-right: 15px;
    max-width:100%;
}

Post a Comment for "Asp Mvc Default Application Generated Remove White Spaces"