2012-07-02 71 views
2

有什么方法可以让文本左对齐并且同一时间对齐吗?意思是左对齐。有什么办法可以做到这一点?感谢帮助。CSS制作文本左对齐并同时对齐

+5

什么? ......... – bfavaretto

+0

左边是什么样的文字同时被对齐和对齐?它与文本是否有区别,是否合理?它与左边没有对齐的文字有什么不同? – twsaef

+0

我想让css文本左对齐并同时对齐。那可能吗? –

回答

8

左对齐意味着文本的左边缘对齐。对齐文本意味着文本的左边缘和右边缘对齐。所以“左对齐和合理”与“合理”没有区别,所以你的问题对我们没有任何意义。

左对齐:

Four-score and seven years ago, our fathers 
brought forth on this continent a new nation, 
conceived in liberty, and dedicated to the 
proposition that all men are created equal. 

有道理:

Four-score and seven years ago, our fathers 
brought forth on this continent a new nation, 
conceived in liberty, and dedicated to the 
proposition that all men are created equal. 

右对齐:

Four-score and seven years ago, our fathers 
brought forth on this continent a new nation, 
    conceived in liberty, and dedicated to the 
    proposition that all men are created equal. 

也许还有一些其他类型的你想达到比对?

3

对齐的文字总是“左右对齐”。

7

合理的意思是文本在两个边上排列。但是,文本的最后一行仍将定位在左侧或右侧。

所以......

左对齐

Lorem Ipsum is simply dummy text of the printing and  | 
typesetting industry. Lorem Ipsum has been the industry's | 
standard dummy text ever since the 1500s, when an unknown | 
printer took a galley of type and scrambled it to make a | 
type specimen book.          | 

左对齐

              | 
Lorem Ipsum is simply dummy text of the printing and 
typesetting industry. Lorem Ipsum has been the industry's 
standard dummy text ever since the 1500s, when an unknown 
printer took a galley of type and scrambled it to make a 
type specimen book.          | 
                  | 

右对齐

              | 
Lorem Ipsum is simply dummy text of the printing and 
typesetting industry. Lorem Ipsum has been the industry's 
standard dummy text ever since the 1500s, when an unknown 
printer took a galley of type and scrambled it to make a 
             type specimen book. 
                  | 

我以前没有用过这个,所以我不能100%确定你想要的特定行为是否被CSS支持。我认为这个来自W3Schools的链接将有所帮助:http://www.w3schools.com/cssref/css3_pr_text-justify.asp

+0

你是对的,你不能用CSS来做这件事,但你的差异的例子非常清楚。这应该是正确的答案 – cfontanet

2

这是一个图像,它有左对齐(左上)和右对齐(右上)文本。

enter image description here

为了让你的CSS,你会使用text-align: justify;左对齐文本。

在Chrome和IE的最新版本中,您可以使用最后一行使用该CSS左对齐的文本。我不确定年龄较大的浏览器如何处理它。

你可以在Photoshop中获得4种类型的对齐文本,完全对齐或最后一行是左对齐,居中或右对齐,但浏览器只支持左对齐。对于从右到左的语言,他们可能有正确的文字。

8

你可能会寻找左对齐的最后一行:

text-align: justify; 
    text-align-last: left; 
+0

这个!该死的谢谢你 – JHolub