Re: Why doesn't this container center?



In article <49dd3436$1_3@xxxxxxxxxxxxxxx>,
John Hosking <John@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

richard wrote:
On Wed, 8 Apr 2009 10:27:03 -0700 (PDT), Mike Silva
<snarflemike@xxxxxxxxx> wrote:

Here's a little test page that should, according to my understanding
and based on what I have read in various places, center the container
box horizontally. It does so on IE, but on Firefox and Safari the box
is on the left. Can somebody explain the problem? Thanks.

Try this version

.test { width:2in; height:2in; background:#ffff7d; margin:auto;}
<div class="test">
sample
</div>


I am now convinced you're just trolling.

What convinced you in particular? The transitional doctype? The use of
inches, bothering about height?

--
dorayme
.



Relevant Pages

  • Re: Clear
    ... Usually this stuff is inside a container and you can ... Dorayme knows more about this ... "Know that overflow does not work for IE6 and a clearing element is ... as I would like so much to have a good IE browser ... ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: HTML-Code nachladen
    ... John Hosking wrote: ... although dorayme is one proponent of a site-wide ... maybe 10 to 20 pages or so and I can feel that half a dozen folk are ... recommend search-and-replace. ...
    (alt.html)
  • Re: Is this Too Much To Ask ? 3-rows, header, fluid middle and bottom footer
    ... I think he has a sticky footer there... ... thanks for the plug, dorayme! ... the latter being called conditionally in the HTML. ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: Centered div with unknown width and floating elements inside
    ... dorayme wrote: ... John Hosking wrote: ... includes pic of browser window)! ... But I liked the puss in the sink. ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: fixed-width column and variable-width columns mixed
    ... If you want the table to be as wide as the container and you want ... We are talking all loose here, ... html really but still... ...
    (alt.html)