I am learning CSS and I am trying to understand this behavior.
section{
display: flex;
flex-direction: column;
align-items: center;
}
.banner-area a.banner-btn{
padding: 15px 35px;
background: crimson;
}
.banner-area {
text-align: center;
}
<section class="banner-area">
<div class="banner-img"></div>
<h1>Flexbox Website</h1>
<h3>Responsive Web Design</h3>
<a href="#" class="banner-btn">Contact us</a>
</section>
I was trying to play with the CSS and I found out that when I removed align-items: center
, the element now takes the entire line, but I couldn't understand why.
Can someone help me understand the reason? Thank you