html – 如何在Bootstrap导航栏中添加多个徽标?

我想在我的bootstrap导航栏中添加两个徽标,但我也希望它们能够响应(即我希望它们变得更小,而不是在我减小屏幕尺寸时堆叠).这是我一直在研究的导航条代码 –

<nav class="navbar navbar-default">
      <div class="container-fluid">
          <div class="navbar-header">
              <a class="navbar-brand" href="#">
                  <img alt="Brand" id="brand1" src="img/image.png">
              </a>

              <a class="navbar-brand" href="#">
                  <img alt="Brand" id="brand2" src="img/image2.png">
              </a>

          </div>
      </div>
  </nav>

任何帮助将不胜感激!

最佳答案 我已经创建了两个徽标并排的示例.

请查看CODEPEN的工作示例

HTML:

<nav class="navbar navbar-default">
  <div class="container-fluid">
    <div class="nav-header">
      <div class="row">
        <div class="col-sm-4">
          <div class="row">
            <div class="col-xs-6">
              <a class="navbar-brand" href="#">
                <img alt="Brand" id="brand2" src="http://www.kratosuk.com/wp-content/uploads/2013/07/joomla-logo.png" class="img img-responsive">
              </a>
            </div>
            <div class="col-xs-6">

              <a class="navbar-brand" href="#">
                <img alt="Brand" id="brand1" class="img img-responsive" src="http://www.kratosuk.com/wp-content/uploads/2013/07/drupal-logo.png">
              </a>


            </div>
          </div>
        </div>

      </div>
    </div>
</nav>

CSS:

.navbar-brand {
  display: inline-block;
  float: none;
  font-size: 18px;
  height: 100%;
  padding: 0;
  vertical-align: middle;
}

我希望它对你有所帮助

请享用 :)

点赞