Hi All,

I ran into what I suspect is a fairly common issue (how to centre a
DIV?) but I couldn't come up with an elegant solution.

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>

This seems to work in every browser but one (Internet Explorer). No
matter what I tried in IE, I couldn't persuade a DIV to do the trick.
So I ended up with a table to kludge the text into submission viz:

  <table align="center">
  <tr><td style="width:600px;">
   -- The running text goes here --
  </td></tr>
  </table>

Although deprecated, align="center" seems to work in all browers (for
now). However, I'd prefer to do this sort of thing 'properly' and
would be grateful for pointers in the right direction.

-- 
Geoff Lane
Cornwall, UK

______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
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