Bootstrap:导航栏徽标大小

Ase*_*sez 5 css navbar twitter-bootstrap twitter-bootstrap-3

我有一个 1700x700 的徽标,我的导航栏高度是 70。我想自动调整大小并使其适应我的导航栏高度。我可以使用 photoshop 将其调整为 170x70,但问题是放大时图像质量下降。

我尝试使用 img-responsive 但它不起作用。

谢谢!

<a class="navbar-brand" href="index.php"></a>



.navbar-brand
{
    position: relative;
    background: url(../images/logo.png);
    width: 170px;
    left: 15px;
}
Run Code Online (Sandbox Code Playgroud)

Sup*_*ser 4

您可以为此设置以下 css

.navbar-brand {
    position: relative;
    background: url(../images/logo.png);
    width: 170px;
    left: 15px;
    background-size: contain;
}
Run Code Online (Sandbox Code Playgroud)