Previous Message
Next Message

Centring incompatibility

Sent by Robyn Smith on 4 September 2004 07:07


Thanks, Keith. That did the trick. It works in both browsers.

Cheers
Robyn

-----Original Message-----
From: Keith Burgin [EMAIL-REMOVED]] 
Sent: Saturday, September 04, 2004 2:37 PM
To: Robyn Smith
Cc: [EMAIL-REMOVED]
Subject: Re: [css-d] Centring incompatibility

> I am working on a site where I want the contents to be centred on any 
> resolution screen. I have two nested divs with the following styles
> 
> #outer{
>   text-align:center;
> }
> #inner{
>   width:700px;
>   height:400px;
>   position:relative; 
>   top:40px;
> }

You're close.

IE requires the "text-align: center;" in the outer div.  However, for the
mozilla browsers you need to add:

"margin: 0 auto;" to the inner div. In other words:

#outer{
   text-align:center;
}
#inner{
   width:700px;
   height:400px;
   position:relative;
   top:40px;
   margin: 0 auto;
}


Good luck,


Keith Burgin
www.burgindesign.com







______________________________________________________________________
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

Message thread: