On 15/06/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Having spent ages learning how to position stuff in CSS and getting > it meticulously right (using the nice hack that I was pointed at > to get IE to behave, too) the client has now said "Oh, can you > make the content centre in the browser?" > > ARGH! If I was still using tables for layout this would be trivial > but I am using absolutely positioned stuff. > > So... My idea is to make a container class for it all, and then > to have everything positioned relative rather than absolute. And > centre the containing class. > > Is this the right idea? Or will it all go horribly wrong? > > I'm only asking for advice, not for you to do all the work for me! > But I thought I'd better ask before I try it, screw up and confuse > myself horribly.... > > Thanks :) > > To centre in the browser there are two main ways, either use the IE heck > (text-align: center then text-align: left etc) but I prefer using relative > positioning and negative margins - example:
#wrapper { width: 740px; position: relative; left: 50%; margin-left: -370px; } which is not a hack. Is this what you are trying to do? -- http://www.web-buddha.co.uk http://www.projectkarma.co.uk ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/