I want a header with an image attached to the left and a div with some text inside, to the right of this image. The div must contain horizontally and vertically centered text.
I tried almost everything like relative positioning, float, inline-blocks and columns but I just can't figure out how.
header {
background-color: rgb(31, 31, 31);
overflow: hidden;
padding: 20px 10px;
}
.header-right {
display: inline-block;
text-align: center;
}
#imageContainer {
float: left;
text-align: center;
padding: 12px;
}
<header>
<a id="imageContainer">
<img id="image" src="test.png">
</a>
<div class="header-right">
<h1>Centered text here</h1>
</div>
</header>
EDIT: someone closed the question saying that this answer my question. But i have to center the text in the space between the image container and the very end of the header's width!