html - Gap between header and navbar -


i having problems gap between header , navbar. have no idea how rid of gap. grateful if here know how repair issue.

<!doctype html> <html lang=en>  <html>  <head>         <script src=java.js"></script>         <link rel="stylesheet" type="text/css" href="style.css">         <meta charset="utf-8">         <meta name="viewport" content="width=device-width, initial-scale=1">         <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>         <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>          <link rel="icon" type="image/jpg" href="link"> <!--browser icon-->          <!-- latest compiled , minified css -->         <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"          integrity="sha384-1q8mtjoasx8j1au+a5wdvnpi2lkffwweaa8hdddjzlplegxhjvme1fgjwpgmkzs7" crossorigin="anonymous">          <!-- optional theme -->         <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css"          integrity="sha384-flw2n01lmqjakbkx3l/m9eahuwpsfenvv63j5ezn3uzzapt0u7eysxmjqv+0en5r" crossorigin="anonymous">          <title>browser page name</title><!--insert page name-->     </head>      <body>          <div class="body">          <div class="jumbotron header">           <div class="container text-center">             <h1>business name</h1> <!--big header name-->             <p>motto or slogan</p> <!--smaller text below header name-->           </div> <!--end of container text center div-->         </div> <!--end of jumbotron header div-->              <!--start of navigation-->             <nav class="navbar navbar-inverse">               <div class="container-fluid">                 <div class="navbar-header">                   <a class="navbar-brand" href="#">websitename</a>                  </div>                 <ul class="nav navbar-nav">                   <li class="active"><a href="#">home</a></li>                   <li class="dropdown">                     <a class="dropdown-toggle" data-toggle="dropdown" href="#">page 1                     <span class="caret"></span></a>                     <ul class="dropdown-menu">                       <li><a href="#">page 1-1</a></li>                       <li><a href="#">page 1-2</a></li>                       <li><a href="#">page 1-3</a></li>                      </ul>                   </li>                   <li><a href="#">page 2</a></li>                    <li><a href="#">page 3</a></li>                  </ul>               </div>             </nav>             <!--end of navigation-->          </div><!--end of body div-->         <!-- latest compiled , minified javascript -->         <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-         0msbjdehialfmubbqp6a4qrprq5ovfw37prr3j5elqxss1yvqotnepnhvp9aj7xs" crossorigin="anonymous"></script>     </body> </html> 

css

.header /* header settings */ {     background-color:#000 !important; /*background color black*/     color:#fff !important; /*font color white*/     height:200px; /*height of whole element*/     font-family:impact, charcoal, sans-serif; /*font of text*/ }  body /*background of page*/ {     background:#ffb3b3 !important; /*background color of whole page*/ } 

please me this looks ugly.

because have .jumbotron class has margin-bottom:30px default in bootstrap.

so need reset it, using margin-bottom:0

note:

  • avoid using !important , bad practice.
  • you have 2 bootstrap-min.js files, when need one.

.header {    /* header settings */    background-color: #000    /*background color black*/    color: #fff    /*font color white*/    height: 200px;    /*height of whole element*/    font-family: impact, charcoal, sans-serif;    /*font of text*/  }  body {    /*background of page*/    background: #ffb3b3    /*background color of whole page*/  }  .body .jumbotron {    margin-bottom: 0  }
<!-- latest compiled , minified css -->  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mtjoasx8j1au+a5wdvnpi2lkffwweaa8hdddjzlplegxhjvme1fgjwpgmkzs7" crossorigin="anonymous">  <div class="body">      <div class="jumbotron header">      <div class="container text-center">        <h1>business name</h1>         <!--big header name-->        <p>motto or slogan</p>        <!--smaller text below header name-->      </div>      <!--end of container text center div-->    </div>    <!--end of jumbotron header div-->      <!--start of navigation-->    <nav class="navbar navbar-inverse">      <div class="container-fluid">        <div class="navbar-header">          <a class="navbar-brand" href="#">websitename</a>         </div>        <ul class="nav navbar-nav">          <li class="active"><a href="#">home</a>          </li>          <li class="dropdown">            <a class="dropdown-toggle" data-toggle="dropdown" href="#">page 1                      <span class="caret"></span></a>            <ul class="dropdown-menu">              <li><a href="#">page 1-1</a>              </li>              <li><a href="#">page 1-2</a>              </li>              <li><a href="#">page 1-3</a>              </li>            </ul>          </li>          <li><a href="#">page 2</a>          </li>          <li><a href="#">page 3</a>          </li>        </ul>      </div>    </nav>    <!--end of navigation-->    </div>  <!--end of body div-->


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -