Im looking for help left aligning and vertically aligning a image in this header.
@import url("https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700");
* {
box-sizing: border-box;
}
img {
float: left;
vertical-align: middle;
}
.header {
padding: 5px;
text-align: center;
background: #222222;
color: white;
font-size: 20px;
}
h2 {
color: white;
}
title {
color: white;
}
body {
font-family: 'Open Sans', sans-serif;
background-color: #2C2C2C;
}
<div class="header" class="frame">
<img src="https://i.imgur.com/pZIRNtP.png" class="logo" alt="logo" />
<h2>This should be center</h2>
</div>
Here is my code for the image (currently its left-aligned but i can't seem to align it vertically. And then it also moves my text to the right when the text should stay in center of div horizontally)
img {
float:left;
vertical-align: middle;
}
I basically need the red image to stay the same size, i just need it to be left-aligned (maybe 50px from left) and be vertically aligned with the header div. But i also need the text to stay in the center of the div, vert and horz.