繁体   English   中英

CSS使文本左对齐并同时对齐

[英]CSS making text align left and justify at same time

有没有办法让文本左对齐并且同时对齐? 意思是左对齐。 有没有办法实现这个目标? 感谢帮助。

您可能正在寻找最后一行的左对齐:

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

左对齐意味着文本的左边缘是对齐的。 对齐文本意味着文本的左边缘和右边缘都是对齐的。 因此,“左对齐和对齐”与“合理”没有什么不同,所以你的问题对我们没有任何意义。

左对齐:

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.

也许你正试图实现其他一些对齐方式?

对齐意味着文本在两条边上排列。 但是,文本的最后一行仍将位于左侧或右侧。

所以...

左对齐

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

合理的文本总是“左右对齐”。

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

在此输入图像描述

要获得左对齐文本,您将使用text-align: justify; 在你的CSS。

在最新版本的Chrome和IE中,您可以获得合理的文本,最后一行使用该css保持对齐。 我不确定旧浏览器如何处理它。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM