The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

dead centre with CSS only

Hi again,

I found this experiment/site on vertical aligning very interesting. I studied the CSS and added some more, to get this nice splashpage. Maybe you are also looking to implement some vertical and horizontal centering, this trick will be for you...

I can confirm that this works very well to set exact margins - so long as the margins in the printer settings are symetrical.

They have to be symetrical because that is what the centering uses as its boundary, but so long as they are and I think also they must be less than the actual desired margins, then all works very well.

Anyway very useful, because that margin problem has been most annoying.

the % is for putting the horizon in place, the contentlayer is fixed size width and 1/2 the width for the margin, putting it to the left of the 0,0 point in the flow, this will be in the middle, but you have to know the width of the contentlayer!

I know I keep asking this, but so far no-one has the bottle (or knowledge) to repond, so I'll give it a go here...

Anyone know how to get the top example (dead center/negative margin kludge) to work in IE5 (mac only?) when using a full, valid (xhtml) DTD?

It seems that IE5 will only implement the above method when using a partial HTML4.01 Transitional DTD (w/o url) or no DTD at all (neither of which are an option in any site I'm gonna put my effort into.)