I have been struggling with this for many hours and still cannot find a solution. I made this nice grid that is customizable with text length and browser change. Now the problem is that I cannot get the text in the middle of the field.
I have tried everything. To achieve this, I used several properties, but nothing worked.
text-align: center; vertical-align: middle; line-height: "same as div";
Css code:
.parent { text-align:center; margin:0px; width:100%; padding:0px; font-size:18px; color:#000; display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-box-pack: justify; -webkit-justify-content: space-between; -ms-flex-pack: justify; justify-content: space-between; } .child { padding:18px 25px; background: rgba(0, 0, 0, .5); list-style-type:none; width:inherit; margin:5px; }
html css alignment vertical-alignment
justme
source share