0

I am beginner and learning web development and I have got one svg logo, and I want to set it up vertically-center of the nav bar. I am not sure how to do that properly.

Issue: the image/svg is going out of the navbar-brand.

enter image description here

Image has a logo class where I have put a width like below:

.logo {
    width: 145px;
}

Question: Why does my logo is going out of the parent navbar brand class. Also, I tried vertical-align: middle but this also does not help. Can someone guide me how to put svg logo, so that it remains vertically-center and do no go out of parent div.

Attempt 1:

vertical-align: middle in logo class

Attempt 2:

center-block in navbar-brand

enter image description here

Unbreakable
  • 7,776
  • 24
  • 90
  • 171

1 Answers1

0

In this JSFiddle there is an example to vertically center the logo

Vertically center logo

 line-height: 50px;
Monica
  • 11
  • 1