How to make renderbody content not to appear below the top fixed nav bar

asp.net-mvc, twitter-bootstrap

Solution

You just need to add some padding to your body-content class.

.body-content {
    padding-top: 36px;  /* choose whatever you want here */
}

This happens because you have your navbar set to fixed, which is taken out of the normal flow.

Problem

Here is my layout code, I'm using Bootstrap v3.0 and Using ASP.NET MVC. The page has to be responsive, I tried using `"space-20"` just below the render body content, it works but it doesn't work on small screens. I'm an absolute beginner in ASP.NET MVC ``` <div class="navbar navbar-fixed-top"> <div class="navbar-inner clearfix"> <div class="container"> @Html.ActionLink("Grikwa Store", "Index", "Home", null, new { @class = "navbar-brand clearfix" }) <div class="navbar-left"> @Html.Partial("_SearchPartial") </div> </div> </div> <div class="navbar-inner navbar-inverse" style="background-color: #68217a;"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li>@Html.ActionLink("Home", "Index", "Home")</li> <li>@Html.ActionLink("About", "About", "Home")</li> <li>@Html.ActionLink("Contact", "Contact", "Home")</li> <li>@Html.ActionLink("Admin", "Admin", "Account")</li> </ul> @Html.Partial("_LoginPartial") </div> </div> </div> </div> <div class="container body-content"> @RenderBody() </div> ```

Original source