防止在 iPhone 上的导航栏品牌中拉伸徽标

Prevent logo stretching in a navbar-brand on iPhone

我有一个 navbar-brand with a logo and button,当菜单折叠时在 iPhone 上查看时它们会伸展。

我怎样才能避免这种情况?

<header id="header">

    <nav class="navbar navbar-inverse navbar-fixed-top" role="banner">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <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="index.html"><img src="images/logo.png" alt="logo"></a>
                <div class="slogan"><p>  PERTAMA DI INDONESIA : </p><div class="slogs">Dengan Formula Plastik Baja</div><p></p></div>
            </div>

            <div class="collapse navbar-collapse navbar-right">
                <ul class="nav navbar-nav">
                    <li class="active"><a href="index.html">HOME</a></li>
                    <li><a href="products.html">PRODUCTS</a></li>
                    <li><a href="works.html">HOW IT WORKS</a></li>
                    <li><a href="projects.html">OUR PROJECTS</a></li>
                    <li><a href="contact.html">CONTACT</a></li>
                </ul>
            </div>
        </div><!--/.container-->
    </nav><!--/nav-->
</header>

尝试将 class="img-responsive" 添加到 img.

<a class="navbar-brand" href="index.html">
  <img class="img-responsive" src="images/logo.png" alt="logo">
</a>