6

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.

Anees Ahmad
  • 121
  • 1
  • 1
  • 5
  • What would text that is simultaneously justified and aligned left look like? How would it differ from text that was justified and aligned right? How would it differ from text that is not aligned left? – twsaef Jul 02 '12 at 02:15
  • I Wanna to make css text-align left and justify at same time. Is that possible? – Anees Ahmad Jul 02 '12 at 02:16
  • 1
    We cannot understand what you mean by "left and justify at same time". Could you post a picture showing how you expect it to look like? – bfavaretto Jul 02 '12 at 02:21
  • 4
    i dont think you understand what "justify" means. "Justified" text is both left and right aligned, therefore saying that you want left-justify makes zero sense. – Darko Jul 02 '12 at 02:22

5 Answers5

22

You may be looking for left align for last line:

  text-align: justify;
  text-align-last: left;
Himanshu Saini
  • 702
  • 11
  • 25
9

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?

Ned Batchelder
  • 364,293
  • 75
  • 561
  • 662
7

Justified means that the text lines up on both edges. However, the last line of the text still will be positioned to the left or the right side.

So...

Left-Aligned

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.                                        |

Left-Justified

                                                           |
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.                                        |
                                                           |

Right-Justified

                                                           |
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.
                                                           |

I've not had use for this in the past, so I'm not 100% sure if this particular behavior you'd like is supported by CSS. I'd think that this link from W3Schools would help, though: http://www.w3schools.com/cssref/css3_pr_text-justify.asp

Dan Lugg
  • 20,192
  • 19
  • 110
  • 174
Jon Schroeder
  • 307
  • 3
  • 8
  • You are right, you can´t do this with css, but your example of the differences is really clear. This should be the correct answer – cfontanet Nov 04 '14 at 20:58
3

Justified text is always "left and right justified".

ErJab
  • 6,056
  • 10
  • 42
  • 54
3

Here's an image, it has both left-justified (top left) and justified (top right) text.

enter image description here

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. I'm not sure how older browsers handle it.

You get 4 types of justified text in Photoshop, fully justified or last line being left, center or right aligned but browsers are only supporting left justified it seems. For right to left languages they probably have right-justifed text.

Larry Lawless
  • 613
  • 6
  • 11