Vertically aligning single line text within a minimum height div

mika7410

New Member
I have a certain class of \[code\]div\[/code\] that contains an icon in the upper-left corner as the background image, and text in the remainder of the \[code\]div\[/code\]. The \[code\]div\[/code\] has a minimum height of 32px so that all of the icon is shown.When there is multiple lines of text, the lines look fine as they stretch the \[code\]div\[/code\] down longer than the minimum height, but when there is only one line, it is not vertically aligned with the centre of the icon.JSFiddle here.Is there any way to get the single line to vertically align, but not mess it up when there are multiple lines?
 
Back
Top