View Full Version : How to center 10% hr on ADE/PRS505


Ankh
04-16-2009, 07:11 PM
ADE on PRS 505 (Linux here, dunno if it affects x86 ADE) happily obeys "width" property for hr tag:
hr {width: 10%;}

Except I have a hell of a time trying to center such a shortened horizontal line. Throwing "text-align:center" CSS property into hr itself doesn't work, nor does it work in "p" and/or "div" wrappers around "hr" tag.

I also tried display:block/margin-right:auto/margin-left:auto method (as described here (http://www.w3.org/Style/Examples/007/center#block)) in all three (hr, p, div) tags, but no joy.

Everything mentioned happily works on both Firefox and Calibre's EPUB viewer. :(

The <p style="text-align: center">n times "em-dash"</p> "workaround" is ... just ugly.

Is there another way?

JSWolf
04-16-2009, 07:15 PM
Does it work in ADE 1.7.x for Windows? The best thing is to try and find out. That way you may not have to keep loading content on your 505 to find what does work if it also doesn't work with desktop ADE.

Ankh
04-16-2009, 07:48 PM
ADE 1.7.1.1085, the same behaviour as on PRS505

kovidgoyal
04-16-2009, 07:55 PM
use a width:100% div that contains a center width:10% span with a border

netseeker
04-16-2009, 08:57 PM
Is there another way?
<hr style="width:10%; margin-left:45%;"/> does work in ADE 1.7 on PC...

Ankh
04-16-2009, 10:05 PM
Thanks a lot, netseeker. I just discovered the very same thing following Kovid's advice (div/span technique, BTW, does not work on ADE).

"margin-right:45%" does work both on ADE/PC and ADE/PRS505