Very minimalist Fiddle : https://jsfiddle.net/vk3gamq5/4/
The parent element of the flex-items is styled as :
#content {
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #fff;
}
and the a tag which is among the flex items is to be styled as a button :
#content a {
/* display: inline-block; */
color: #fff;
text-decoration: none;
background-color: #28a745;
margin-top: 10px;
padding: 13px 40px;
border-radius: 10px;
}
'a' tags (which are inline) when styled as a button (as above) require to respect the padding and margins of itself and its immediate neighbors. Generally to do so they need to be styled as inline-block. But here the 'a' tag is respecting all padding or margin values of itself and its immediate neighbors without display:inline-block property. Why is that ?
Edit : (Additional Query)
If i comment out 'align-items:center' for the styling of the parent element, the flex items should move all the way left along the cross axis (which is the horizontal axis in this case). But not only are the flex-items are moving all the way left, the 'a' tag is also changing. It is suddenly going all the way across from left to right. How can one explain that ?