Trying to vertically center an SVG logo inside a parent container
I am trying to vertically center the Kaiser logo on this page so it maintains the center position, despite the browser width.
I was successful getting the building background to sit center and center and cover... I got the logo to horizontally align, but after trying multiple things like padding-top as a percentage, but that didn't work... (I get why) or tried vertical-align, but that's only for inline elements... I'd set it to display: inline and it broke my horizontal positioning...
(I also have a pattern Im trying to get to overlay the building image [called bg-overlay], which did, but shows and doesn't show depending on what I'm trying out on the logo.svg. I'm putting a pin in that and trying to get the logo positioning working... so that element might be screwing something up too.)
<div class="header_image"> | |
| <div class="bg-overlay"> | |
| <img id="kaiser_logo" src="images/svgs/logos/kaiser_logo.svg"> | |
| </div> | |
| </div> | |
CSS
.header_image {
background: #e6e9ed url(/images/headers/kaiser.jpg);
background-size: cover;
background-position: center center;
height: 400px;
width: 100%;
margin-left: auto;
margin-right: auto;
}
.bg-overlay{
min-height:400px;
}
.header_image .bg-overlay{
background: rgba(0,0,0,0.2) url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAD0lEQVQIW2NkQABjRmQOAAM+AGkQsDBSAAAAAElFTkSuQmCC) repeat;}
#kaiser_logo {
width: 70%;
margin-left: auto;
margin-right: auto;
}
/*
.quote {
background-color: #0097A7;
max-height: 455px;
width: 100%;
z-index: -5;
}
*/
