How to vertically align text in the middle of a div that has a percentage height? [duplicate]
问题 This question already has answers here : How do I vertically align text in a div? (30 answers) Closed 5 years ago . Here is what I have right now. In other divs using vertical-align:middle and setting the line-height to the same value as the height property it should work!The only thing is that in those divs I used pixel dimension and not percentages. Can anybody tell me why this wont work with percentages? also setting the text-size to 50% should also make text half the size of the div but