Search code examples
htmlcssbootstrap-grid

The The content does not appear in the correct position in the Grid system. Bootstrap


I have problem here with the logo and navbar in the design. There are 3 column for the logo and 6 for navbar like this image

enter image description here

But when I running the code They do not appear in the correct position and I do not now where is the mistake in the code. they are come like this in browser:

enter image description here

This is HTML code and css:

body {
  font-family: 'Raleway' font-size: 16px;
  color: #fff;
  font-weight: 400;
  letter-spacing: 1px;
  background: #003153;
}

header {
  background: url(images/home-bg.png) center repeat-y;
  min-height: 760px;
  width: 100%;
  padding: 50px;
}

.navbar {
  background: 0;
  padding: 0;
  border: 0;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Raleway:400,300,500,600,700" rel="stylesheet" type="text/css">
<!--header-->
<header>
  <div class="container">
    <div class="row">
      <div class="col-lg-3 logo"><img src="images/Logo.png" alt="logo"></div>
      <div class="col-lg-6 menu">
        <nav class="navbar navbar-default">
          <!-- Brand and toggle get grouped for better mobile display -->
          <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="mainMenu" aria-expanded="false">
                    <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="#"></a>
          </div>
          <!-- Collect the nav links, forms, and other content for toggling -->
          <div class="collapse navbar-collapse" id="mainMenu">
            <ul class="nav navbar-nav">
              <li class="active"><a href="#">Home <span class="sr-only">(current)</span></a></li>
              <li><a href="#">About me</a></li>
              <li><a href="#">Courses</a></li>
              <li><a href="#">Gallery</a></li>
              <li><a href="#">Articles</a></li>
              <li><a href="#">Contacts</a></li>
            </ul>
          </div>
          <!-- /.navbar-collapse -->
        </nav>
      </div>
      <div class="col-lg-3 search"></div>
    </div>
  </div>
</header>

Thank you


Solution

  • You have to put =(equals to/ assignment operator) with each class attribute it should be

     <div class="col-lg-3 logo"><img src="images/Logo.png" alt"logo"></div>
     <div class="col-lg-6 menu">