The role of line-height

       line-height in the written explanation is vertically centered on a single line of text. Have effect only a single line of text.

Today made a html page, whim, wanted to set up a parent box line-height, let the child inside the box vertically centered;

Since we are to make a single line of text centered vertically, then I loaded this text box with a child, then you can achieve sub-box center;

It found to be possible, unless the sub-set width and height of the box, the default text width and height, can be achieved. But the wide set anything higher. Although the child may inherit box line-height,

But only for the row height for the sub-box, not the parent box.

Guess you like

Origin www.cnblogs.com/lvyier/p/11489190.html