Please help me how to align the text in the block and vertically and horizontally. Thank you in advance! So that in the span with the button text is exactly centered and vertical and horizontal.
.flex-container { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: flex-start; align-content: flex-start; max-width: 905px; margin: 0 auto; } ul.flex2 li { width: 150px; height: 200px; border: 3px solid; margin: 20px; margin-top: 100px; display: inline-block; text-align: center; } span.button1 { margin: 5px 0px 5px 0px; height: 40px; background-color: green; } span { max-width: 150px; max-height: 200px; display: block; } <div class="flex-countainer"> <ul class="flex"> <li><span>text</span><span class="button">text</span><span></span> <li><span>text</span><span class="button">text</span><span></span> <li><span>text</span><span class="button">text</span><span></span> <li><span>text</span><span class="button">text</span><span></span> </ul> </div>