1

我在设计logo中遇到了问题navbar。有 3 列logo和 6列navbar这样的图像

在此处输入图像描述

但是当我运行代码时,它们并没有出现在正确的位置,我现在也不知道代码中的错误在哪里。它们在浏览器中是这样的:

在此处输入图像描述

这是 HTML 代码和 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>

谢谢

4

1 回答 1

0

您必须将=(等于/赋值运算符)与它应该是的每个类属性放在一起

 <div class="col-lg-3 logo"><img src="images/Logo.png" alt"logo"></div>
 <div class="col-lg-6 menu">
于 2018-01-04T04:58:12.800 回答