I'm new to HTML/CSS and I still have difficulties with vertical alignment, although I have read several articles on this topic.
Consider the following code.
header {
display: flex;
}
header div {
width: 150px;
height: 150px;
background-color: grey;
}
header h1 {
display: inline-block;
vertical-align: middle;
background-color: orange;
margin: 0;
}
<body>
<header>
<div></div>
<h1>My title here</h1>
</header>
</body>
What I am trying to achieve is this:
I have tried the techniques described here but I still don't manage to get this result. What is the best solution?