平衡文本环绕在HTML中 [英] Balanced text wrapping in HTML

查看:176
本文介绍了平衡文本环绕在HTML中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在HTML中,有没有办法平均分配跨越多行的文本?

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

例如,我不想:


   Here is some really long label that ends up on
   two lines.

我更喜欢:


                  Here is some really long label 
                      that ends up on two lines.


推荐答案

在纯HTML / CSS中没有办法实现这一点,没有办法测量行的长度。

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

一个方法是使用javascript,但是你会得到一个FOBUC,而javascript计算行长度并相应地拆分。

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.

避免这种情况的最好方法是使用PHP / ASP /无论你使用什么都分开。

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

这篇关于平衡文本环绕在HTML中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆