Thread: margin: 0 auto;
View Single Post
Old 07-16-2010, 03:34 PM   #14
EricDP
Groupie
EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.EricDP ought to be getting tired of karma fortunes by now.
 
Posts: 165
Karma: 339490
Join Date: May 2010
Device: nook, BlackBerry
Quote:
Originally Posted by troymc View Post
It's poetry - I was trying to mimic the author's original layout.
My workaround is to create a centered block, and then inside that create an inline-block that is left aligned.

Problem: inline-blocks can't wrap pages (because they are treated as a single element).
Solution: create a separate block for each verse - hopefully your verses aren't too long.

New Problem: Using the above solution, each verse will now be centered relative to its own line lengths, not relative to the entire poem.
Solution: create a custom negative margin for each verse (except the widest, of course) to align the left edges of all the verses. If you specify this margin in "em" instead of "%" it will stay fairly close to aligned at different font sizes/different screen widths.

It's not perfect, but it's the best I can come up with given the current limitations.

If you want some sample code, I can post it later when I get home.
EricDP is offline   Reply With Quote