Balanced text wrapping in HTML

后端 未结 4 1145
旧时难觅i
旧时难觅i 2020-12-03 21:03

In HTML, is there a way to evenly distribute text that is broken across multiple lines?

E.g., I don\'t want:

   Here is some really long label that ends         


        
4条回答
  •  独厮守ぢ
    2020-12-03 21:48

    In pure HTML/CSS there isn't a way to accomplish this, because there is no way to measure the length of the line.

    One way to do this would be with javascript, but you will end up with a FOBUC while the javascript calculates the line length and splits it accordingly.

    The best way to avoid that would be to split the line with PHP/ASP/Whatever you're using.

提交回复
热议问题