Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS making text align left and justify at same time

Is there any way to make the text align left and justify as same time? Mean something like left-justify. Is there any way to achieve this? Thanks for help.

like image 511
Anees Ahmad Avatar asked Jul 02 '12 02:07

Anees Ahmad


People also ask

How do I make text left justified in CSS?

To left justify in CSS, use the CSS rule text-align: left. In the example below, the div element is set to center all content inside it.

How do you justify left and right in CSS?

To get the left justified text you would use text-align: justify; in you css. In the latest versions of Chrome and IE you get justified text with the last line being left aligned using that css.


2 Answers

You may be looking for left align for last line:

  text-align: justify;
  text-align-last: left;
like image 165
Himanshu Saini Avatar answered Sep 19 '22 14:09

Himanshu Saini


Left-justified means that the left edge of the text is aligned. Justified text means that both the left edge and the right edge of the text is aligned. So "left-aligned and justified" is no different from "justified", so your question doesn't make any sense to us.

Left-aligned:

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.

Justified:

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.

Right-aligned:

  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.

Perhaps there's some other kind of alignments you're trying to achieve?

like image 38
Ned Batchelder Avatar answered Sep 21 '22 14:09

Ned Batchelder