How to vertically align image and text in table cell?
问题 I'm trying to get the text to be on the right side and vertically center aligned with the image. How can I do that? My current code: <div style="display: table;"> <div style="display: table-cell;"><img src="//dummyimage.com/100"></div> <div style="display: table-cell;">text</div> </div> 回答1: use CSS3 Flexible Box Layout: from the documentation: providing for the arrangement of elements on a page such that the elements behave predictably when the page layout must accommodate different screen