How to capture one line of text in a div

后端 未结 4 805
情书的邮戳
情书的邮戳 2021-01-12 14:20

I\'ve looked around at similar SO posts related to this, but none deal with exactly what I am looking for. Say I have some text, I throw it in a div, and add some arbitrary

4条回答
  •  悲&欢浪女
    2021-01-12 14:50

    Bob Monteverde provided a very nice piece of code to calculate a Strings width here. You could use that and start comparing string widths with the actual width of your div to find single lines.

提交回复
热议问题