簡體   English   中英

Bootstrap導航欄品牌徽標-肖像圖像已被截斷?

[英]Bootstrap navbar-brand logo - portrait image has been cut off?

在此頁面后面使用導航徽標而不是文字徽標表示導航欄品牌時,我遇到了以下問題: 縱向徽標已被其后的任何內容/文本/圖像/旋轉符號切斷。

我該如何解決?

<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <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="#">
        <img src="http://placehold.it/150x200&text=Logo" alt="">
    </a>
</div>

結果:

在此處輸入圖片說明

嘗試在您的導航欄中添加z索引,就像在CSS文件中那樣,因為它看起來像您的前景圖像重疊了它

.navbar-header {
   z-index: 100;

}

將最大高度添加到img。

max-height: 100%;
height: 100%;
width: auto;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM