Note: This method has a limitation that it can vertically center only one line of text. In this method, all you need to do is specify the line-height same as the container’s height.įor example, if the height of the container is 200px, the line-height should also be 200px. This is the easiest approach to vertically center the text inside its container. ![]() Vertically Center Text using the line-height Property
0 Comments
Leave a Reply. |