jmcgriff60 Posted July 26, 2009 Share Posted July 26, 2009 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 More sharing options...
dsonesuk Posted July 26, 2009 Share Posted July 26, 2009 something like this?<p style="text-align:justify; margin: 0 auto; width: 60%;">Center me please, Center me please, Center me please, Center me please, Center me please, Center me please, Center me please, Center me please, Center me please, </p> Link to comment Share on other sites More sharing options...
jmcgriff60 Posted July 26, 2009 Author Share Posted July 26, 2009 Yeah. That does the trick. I thought I had tried margin:0 auto, but I guess I didn't, at least not in combination with the other right things. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.