Previous Message
Next Message

Re: centering problem

Sent by Johan on 20 September 2005 03:03


Hi,

Use a extra outerwrapper div. Put center code in there plus the body for 
IE5.0 (if need support)

the HTML

<div id="outerwrapper">
<div id="shadow">
<div id="content">
	<div id="main-content">
....
</div>
</div>
<div id="shadow-bottom"></div>
</div> <!-- // #wrapper -->


The CSS

body {
	background-color:#FFFFCC;
	font-family:"Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
	height:100%;
	margin:0;
	padding:0;
	/* @styles to invoke centering in IE5.0 WIN */
	text-align:center;
	}
#outerwrapper {
	text-align:left;
	position:relative;
	margin:0 auto;
	width:749px; /* took the largest width thus off the shadow div, can be even a little more */
	}

You can remove margin:0 auto from #content,#shadow-bottom, #shadow since the outer wrapper
will vertical center them already.

Try it out. It worked for eg IE 6, ... 


Regards,


Johan



______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Possibly related: