I was originally setting the line-height equal to height, but if the text is too long and wraps to the next line, it creates a huge space between the two lines. :(
Ah, line-height is for one line text... here the multi-line way:
It's like converting this paragraph into a table (using display), so that we can use vertical-align
<style>p{background-color:red;width:150px;height:150px;display:table-cell;vertical-align:middle;}</style><p>whatever stuff right here to go to the next line</p>
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I was originally setting the line-height equal to height, but if the text is too long and wraps to the next line, it creates a huge space between the two lines. :(
Ah, line-height is for one line text... here the multi-line way:
It's like converting this paragraph into a table (using display), so that we can use vertical-align