html – how to align center vertically each element of a div?


i’m trying to align center vertically each element of a div but i can’t do it. I have tried with vertical align but it isn’t working. This is my div/html

enter image description here

I want each element centered like this

enter image description here

This is my code

<section class="banner" id="banner">
    <div class="banner-text">
        <h2>Hola, yo soy <span>Diego Donoso</span>.</h2> 
        <h3>Técnico Analista Programador.</h3>
        <a href="#about" class="btn">Sobre Mí</a>
    </div>
</section>

My CSS

.banner{
  display: flex;
  justify-content: center;
  align-items: center; 
}



Source link

Latest articles

Related articles

Leave a reply

Please enter your comment!
Please enter your name here