View Full Version : ePub files do not center a custom <hr /> tag!


Haidon
08-21-2010, 12:59 AM
Well, this is annoying. I've set up a custom <hr /> tag that is supposed to look like those fancy triple asterisms you see in real printed books. I've used the following css:

hr { display: block; height: 1.15em; background: #FFFFFF url(../img/hr.svg) no-repeat scroll center; border: none; margin: 1em auto; }


Everything works fine except for the centering! I've also tried 'text-align:center;', and you'll see that the background tag tells it to center as well as the margin tag! (I added 'display:block;' just to see if that did anything—no luck.) Does the ePub specification not include this? Is the software just broken? Or am I doing it wrong?

HarryT
08-21-2010, 03:20 AM
Yes, this is a well-known bug in ADE. You have to centre your rule by setting a left margin equal to half the space left over by it. Eg, if your rule is 20% of the page width, set the left margin to 40% (half of the 80% not occupied by the rule).

charleski
08-21-2010, 04:29 AM
See this thread (http://www.mobileread.com/forums/showthread.php?t=94733).