Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

How to prevent whitespace when line wraps?

Hi guys,

I have an issue at smaller screen sizes where because of a long word the line breaks and leaves a lot of whitespace. See below:

[img]http://i.imgur.com/ya060UZ.png?1[/img]

Is there anyway I can prevent this and ensure the lines are horizontally more even?

Thanks Joe

2 Answers

Hi Joe! Use the css property text-align: justify;

Hi pi R,

thanks for the suggestion.

That does work but the problem with using text-align: justify is that you end up getting wide letter spaces at random times in your text.

I was wondering if there was a cleaner way to do it.

Thanks Joe

UPDATE: It seems I was viewing my screen at around 200px anyway which is smaller than any device. Once I went up to around 320px it was wide enough to resolve the issue.

Thanks