1

I've got a client who wants a paragraph of text to appear justified and rather than having the last line flush left, they want it centered. I haven't come up with a way to do this yet that will properly scale if the page is resized by the user. Am I going to have to resort to some kind of javascript hack? I just feel like this is the sort of problem that I should be able to solve with CSS alone.

juliomalegria
  • 24,229
  • 14
  • 73
  • 89
NSU
  • 309
  • 3
  • 10
  • Duplicate of http://stackoverflow.com/questions/4771304/justify-the-last-line-of-a-div – duri Sep 18 '11 at 21:24

1 Answers1

2

CSS3 has a text-align-last property that you might find useful. On the other hand, using a different text-justify method might be preferred.

Bart
  • 19,692
  • 7
  • 68
  • 77
Jonathan Wilson
  • 4,138
  • 1
  • 24
  • 36
  • I tried out css3's text-align-last property already, do you know if any browsers actually support it? As far as I can tell Chrome, Firefox, and Safari don't which, sadly makes it useless. – NSU Sep 18 '11 at 21:09
  • @NSU Internet Explorer supports both properties. – duri Sep 18 '11 at 21:21
  • Yeah, just found out the same myself. Sadly, _only_ IE supports text-align-last. I'll probably do some weird hack with nonbreaking spaces and see how well that works. – NSU Sep 18 '11 at 21:26