简体   繁体   English

Bulma-Navbar徽标图像不适应导航栏高度。 如何更改徽标图像适合度?

[英]Bulma - Navbar logo image is not adapting to the navbar heigh. How can I change the logo image fit?

I have just started using Bulma ( bulma.io ) and want this image to resize to the navbar height which I belive by default is 3.25rem (16px base font-size) but it is not. 我刚刚开始使用Bulma( bulma.io ),并希望将此图像调整为导航栏的高度,默认情况下,我认为该高度为3.25rem(16px基本字体大小),但不是。

I have tried resizing the image to 600px x 140px no luck, I have googled around a lot and still cant fix it. 我已经尝试过将图片的大小调整为600px x 140px,但没有运气,我在Google上搜索了很多,但仍然无法修复它。 Yet if I use the example bulma image which is 600px x 140px it works? 但是,如果我使用600像素x 140像素的示例bulma图像,它可以工作吗? Here is the code Using the bulma image 这是使用bulma图像的代码

 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css"> <nav class="navbar"> <div class="navbar-brand"> <a class="navbar-item" href="#"> <img src="https://bulma.io/images/bulma-logo.png"> </a> </div> </nav> 

or jsfiddle jsfiddle

My code 我的密码

 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css"> <nav class="navbar"> <div class="navbar-brand"> <a class="navbar-item" href="#"> <img src="https://preview.ibb.co/bVUFKU/logo_transparent.png" alt="logo_transparent"> </a> </div> </nav> 

or jsfiddle jsfiddle

The logo image you are referring to is 640x640 with white space, either you crop the logo image or use it as background-image as shown below 您所指的徽标图像是640x640带有空白,可以裁剪徽标图像或将其用作background-image ,如下所示

 .navbar-item { background: url(https://preview.ibb.co/bVUFKU/logo_transparent.png) no-repeat center center; background-size: cover; width: 152px } 
 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css"> <nav class="navbar"> <div class="navbar-brand"> <a class="navbar-item" href="#"></a> </div> </nav> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM