开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜