Quote:
Originally Posted by Rapunzel
...I’m still searching for a way to successfully center a block of left-aligned text with an unknown width in an epub.
|
According to the example you posted about the method you're currently using, actually you are using a width of 100% and with padding, you are adding some space on left and right margins. So, instead of using "padding" you can use the property "width" (i.e. 90%) and margins (left and right) of 5%.
Code:
/* Centered & Left-aligned text */
div.quote {
margin: 2em 5%;
width: 90%;
}
div.quote p {
text-indent: 0;
font-size: .85em;
text-align: left;
margin: 0;
}
div.quote p.sig {
margin: 1em 0 0;
text-align: right;
} /* For signature line */
Code:
<div class="quote">
<p>This is a paragraph of some sort. It can be of any length. The div will be centered on the page with the text left aligned within the div.</p>
<p>You can adjust the width of the block (and margins) to give more/less space on either side.</p>
<p class="sig">From the <em>Memoirs of Dion</em></p>
</div>
Of course, the width of the text block plus left and right margins must be 100%
Regards
Rubén