CSS Centering

Someone just sent a screenshot of the gallery below on a Mac (thanks Dave!), and it wasn't displaying properly. The latest version of snapGallery has an all-CSS layout, and it appears there's some problems with the technique I'm using to center everything on the page. Do any CSS experts out there know a cross-platform way to center information on a page both horizontally and vertically using only CSS? (no tables.)
« Previous post / Next post »

Comments

I like these solutions http://www.milov.nl/forum/1/28 for CSS centering.
I am unable to read and follow simple instructions.
No problem, that's why comments systems have erasers, er, editing features. That's the technique I'm using to center images. Apparently it doesn't work in some Mac browsers. The thread does allude to a !DOCTYPE problem on the Mac, though. I wish I had one to test on.
For what it's worth, the negative margins are apparently causing the screw-up in Safari. I have almost never had success with negative values in CSS.

I did try dropping the margins, and that at least got the image on the visible page. But now it's ignoring the top value... which might be a browser bug.

CSS is just about the funnest thing ever.
As far as I know, using negative values is the only way to vertically center something on a page. Yep, CSS is a blast. It's supposed to be *better* than HTML for stuff like this!
Hi! You're reading a single post on a weblog by Paul Bausch where I share recommended links, my photos, and occasional thoughts.
×

Search Results

No emoji found