Vertical centering text (jQuery)

Posted by Nimbuz on Stack Overflow See other posts from Stack Overflow or by Nimbuz
Published on 2010-04-01T11:21:21Z Indexed on 2010/04/01 11:23 UTC
Read the original article Hit count: 360

Filed under:
|
|
|
<div style="width: 100px; height:50px; line-height:50px; overflow:hidden;">
    <p>A short line</p>
</div>

<div style="width: 100px; height:50px; line-height:50px; overflow:hidden;">
    <p>A really really really long line</p>
</div>

Wrapped text in the second example gets cut off because of the line-height:50px which should be 25px in this case. How do I use jQuery to find if theres single or multi-line text in an element?

Thanks!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about html