Remove the top of the page from Bootstrap

In my code, I have a permanent gap at the very top of my page, which is apparently set to the Bootstrap tag. I searched through the Firefox inspector and found nothing. Trying to add margin: 0; filling: 0; did nothing to the tag.

The #intro div here should be in the upper right, but a space appears above it.

<body> <div id="intro" style="width: 100%; padding:0; margin:0; text-align:center;"> <h2>Test</h2> </div> <nav class="navbar navbar-default" role="navigation" style="margin: 0; opacity: 0.95;"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#" id="brand-mobile">Map My Cash</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1" style="text-align: center;"> <ul class="nav navbar-nav" id="navbar-media-query" style="float: none; display: inline-block;"> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> </ul> </li> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav> @RenderBody() </body> 
+7
javascript jquery html css twitter-bootstrap
source share
6 answers

You will have to override the default css value.

Add the following CSS after the default boot CSS:

 body{ padding-top:0px; margin-top: 0px; } 
+7
source share

Got! The h1 problem was a problem. I added:

 h1 { margin-top: 0; } 

No spaces at the top of the page anymore!

+3
source share

You should add "margin: 0; padding: 0;" body tag

+1
source share

I had to set a border to get rid of the spaces at the top.

 <body><div style="border-top:solid black 1px;"><my-app>Loading...</my-app></div> 
+1
source share

Can you try using reset css.there, it is possible that the div or body may have a default padding or margin.

0
source share

I found the problem in Site.css in the Content folder in my project.

 body { padding-top: 50px; padding-bottom: 20px; } 

I just commented on the filling.

0
source share

All Articles