I'm working on aligning an image vertically in my header. Currently, it's horizontally centered.
header {
background-color: blue;
height: 118px;
width: 1024px;
text-align: center;
}
.container {
margin-left: auto;
margin-right: auto;
width: 1024px;
}
<div class="container">
<header>
<img src="https://i.imgur.com/dKLmNz6.png" alt="JPAD Logo">
</header>
</div>
I've tried searching for a solution and was able to get the image aligned vertically in the center, but then I couldn't get it horizontally aligned with text-align:
header {
background-color: blue;
height: 118px;
width: 1024px;
text-align: center;
display: flex;
align-items: center;
}
.container {
margin-left: auto;
margin-right: auto;
width: 1024px;
}
<div class="container">
<header>
<img src="https://i.imgur.com/dKLmNz6.png" alt="JPAD Logo">
</header>
</div>
I am new to HTML+CSS. Any suggestions?