centering

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bill

    centering

    Hi


    Margin: auto doesn't seem to work in IE.

    Is there another way to have a <div> smaller than the screen to be centered
    for any scr.width ?
    Like <table align="center"> does.

    Thanks


  • Els

    #2
    Re: centering

    Bill wrote:
    [color=blue]
    > Margin: auto doesn't seem to work in IE.
    >
    > Is there another way to have a <div> smaller than the screen to be centered
    > for any scr.width ?
    > Like <table align="center"> does.[/color]



    The reason your IE doesn't respond to auto:margin, is probably that
    you don't have a complete doctype. Means it will be in Quirksmode, (as
    opposed to standards mode), just like IE5 naturally is.

    The above link shows how to deal with IE5, and that should work for
    IE6 in Quirksmode too.

    --
    Els http://locusmeus.com/
    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
    Now playing: Extreme - Color Me Blind

    Comment

    • David Dorward

      #3
      Re: centering

      Bill wrote:
      [color=blue]
      > Margin: auto doesn't seem to work in IE.[/color]



      --
      David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
      Home is where the ~/.bashrc is

      Comment

      • sschling@gmail.com

        #4
        Re: centering

        css:
        #container {
        margin: 0 auto;
        width: 760px;
        }

        html:
        <div id="container" >
        hello
        </div>

        If you have the correct doctype as Els mentioned, this should work

        Comment

        • Bill

          #5
          Re: centering

          Thanks to you all

          <doctype > did the work




          Comment

          • Jim Moe

            #6
            Re: centering

            Bill wrote:[color=blue]
            >
            > Margin: auto doesn't seem to work in IE.
            >[/color]
            You must also set a width less than 100%.

            --
            jmm dash list (at) sohnen-moe (dot) com
            (Remove .AXSPAMGN for email)

            Comment

            Working...