> -----Original Message-----
> From: [email protected] [mailto:[email protected]
> discuss.org] On Behalf Of Philippe Wittenbergh
> Sent: Saturday, March 26, 2011 10:13 AM
> To: Geoff Lane
> Cc: CSS-D
> Subject: Re: [css-d] How to centre a DIV?
> 
> 
> On Mar 26, 2011, at 8:11 PM, Geoff Lane wrote:
> 
> > My son has an eBay listing (so he can only alter some of the body and
> > none of the head). In this he has images that are all of the same
> > width (600px) and each centre aligned in its own paragraph (<p
> > style="text-align:center">). The text of his listing is
> > left-justified, but he wants to position it in a block the same width
> > and lateral position as the images:
> >
> > My first stab was:
> >  <div style="width:600px; margin-left:auto; margin-right:auto">  <p>
> > -- The running text goes here -- </p>  </div>
> 
> The old hack to center a block level element in IE / quirks mode should
still
> work, or am I missing something ?
> <div style="text-align:center">
>     <div style="width:600px; margin: auto; text-align: left;"> content
</div>
> </div>
> 
> Philippe
> --
> Philippe Wittenbergh
> http://l-c-n.com/
> 


Well, I believe Quirks mode is in control here as stated before. In this
case try this:
<div>
   <center>
     <p style="width:600px;"> -- The running text goes here -- </p>
   </center>
</div>
Yes, it's a hack and in Quirks mode Hacking is the way to go unfortunately.
This will center the p element in quirks mode.

______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to