Sent by John Brooks on 27 February 2002 14:02
e. jordan wrote
> I can't seem to figure out how to center a single image
> horizontally and vertically on a single page.
if you know the exact dimensions of what you're trying to center, you can
use milo's trick:
http://www.milov.nl/iambald/93.html
basically, you absolutely position the element's left side at 50%, then the
top side at 50%, then set its margin-left to -Xpx (where X is half the width
of the element in pixels) and the margin-top to -Ypx (where Y is half the
height of the element in pixels).
the caveat of this trick is that you must know the width and height of the
element you're trying to position, so it's not much good if you actually
want content on that page. but if you're just shooting for an image and
nothing else, it should work fine. and it probably doesn't work in ns4
(though i haven't tried it).
pup
http://www.tastylog.com/