Text-align justify but to the right?

2019-01-18 02:05发布

We want to make text-align:justify, to take all the width of the column, but it should start from the right side. Is there any way to make it with css or somehow?.

EDIT:

As suggested http://jsfiddle.net/dVbJr/33/

.text {
  text-align: justify;
  direction:rtl;
}

works, but it has punctuation issue.

SOLVED

    <span style="float:right">...</span>

This to be attached in the end has solved the punctuation issue. Thanks for effort though to everyone! I shall accept the first answer then.

标签: html css layout
6条回答
地球回转人心会变
2楼-- · 2019-01-18 02:35

CSS

text-align: justify; 
text-align: right; // or text-align: left right; 
查看更多
地球回转人心会变
3楼-- · 2019-01-18 02:38
text-align-last: right;
-moz-text-align-last: right;

If I understand the question correctly, the issue is really just how to right-align the last line of a justified block of text. The above does just that, using a property in CSS 3 Text (with a vendor prefix version for better support), supported by modern browsers though not universally.

Though setting the writing direction to right-to-left causes this, among other things, it has several other, more fundamental effects. You may get away with it, if you don’t ever have inherently right-to-left characters in the text.

查看更多
Evening l夕情丶
4楼-- · 2019-01-18 02:41

check this sample

for right-to-left you just need to set direction:rtl

查看更多
迷人小祖宗
5楼-- · 2019-01-18 02:50

I believe you might want something like this:

direction:rtl;
text-align:justify;

Example: http://jsfiddle.net/aew75/

查看更多
做自己的国王
6楼-- · 2019-01-18 02:52

It can be solved by adding text-align-last Here

查看更多
萌系小妹纸
7楼-- · 2019-01-18 02:56

Just try this.

text-align:right justify;
direction:rtl; 
查看更多
登录 后发表回答