Jump to content

Centering A Block Of Justified Text Within A Div


Recommended Posts

I have been beating my head trying to figure out how to do this. I have a navigation div 125px wide on the left side of the page, then a main div to its right with CSS text-align:center applied to it. This works fine for single line paragraphs (title, contact info, and so on), but then I have a paragraph of text that I would like to be about 60% of the width of the div and either text-align:left or text-align:justify. (I prefer justify).I can do this easily using a table (I know, stay away from the table for layout :) ), or with a fixed left margin that pushes the block to the center. But I would like a more general way to center the justified text, which would allow for different widths and not require specific calculations.Is there a good way to do this?Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...