< html >
< head >
<title></title>
< / head >
< body >
< div style= "text-align: center; width: 500px10 height Heights 200px; line-height:200px; border: green solid 1px;" >
https://www.baidu.com/img/bai.; style= "display: inline-block; vertical-align: middle;" / >
< / div >
< / body >
< / html >
1. Set the row height on the parent element. (generally speaking, shouldn"t you set the line height of the child element to be equal to the height of the parent element? the picture may not be as high as the row height, so it is invalid? )
2. Set the Vertical br in img! In the description of W3C, please see the following figure
it says to align vertically according to the baseline of the line in which the element is located, and the following says to place the secondary element in the middle of the parent element! (writing vertical-align on img alone cannot be centered vertically)
I"m lost! So how on earth do you use this line-height and vertical-align?
Don"t talk to me aboutps, other display:table; and absolute positioning. I know! I just want to know how the above code explains ~