Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text-align justify but to the right?

Tags:

html

css

layout

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.

like image 270
Anonymous Avatar asked May 21 '12 11:05

Anonymous


People also ask

How do you justify text to the right?

The alignment keyboard shortcut keys can vary depending on what program is used and the type of computer. However, generally speaking, use Ctrl + L to left align, Ctrl + E to center, Ctrl + R to right align, and Ctrl + J to justify text.


2 Answers

I believe you might want something like this:

direction:rtl; text-align:justify; 

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

like image 66
Jason Gennaro Avatar answered Oct 01 '22 19:10

Jason Gennaro


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.

like image 43
Jukka K. Korpela Avatar answered Oct 01 '22 17:10

Jukka K. Korpela