CSS/Javascript: How to count the number of displayed lines of an element?
Is there a simple way to count the number of lines of 开发者_运维技巧a display:inline-block element? I need to know how may lines the child elements are arranged into. Thanks!
No there's no simple way. You'd have to use javascript and do some maths. To get the height of a line you'd need to get the font-size and add the line spacing. Then divide this by the element height.
精彩评论