I want to center the image on the right vertically, so that it is centered between the two green titles, can somebody help me with this?
my CSS code:
.vorigejaren img {
width: 25%;
height: auto;
float: right;
}
.vorigejaren p {
display: inline;
}
My HTML code:
<div class="vorigejaren">
<img src="../fotos/leden/Praesidium/Groepsfoto_2022_aangepast.jpg" alt="foto">
<p><?php echo $jaar['leden']; ?></p>
</div>
I tried looking it up on the internet, but noru-yhing seemed to work…
2
Answers
Please use a flex box (flex-direction:row) to enclose two DIVs each of say 50% width so that the right hand side one can use align-self:center; to make itself vertically align
I have made two rows of the contents to show it.
Please click "Run code snippet" and then click "Full page" to see the effect
[![enter image description here][1]][1]