having something in the middle of the screen.....

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

    having something in the middle of the screen.....


    Hi,

    I would like to position a site in the "middle" of the screen, both
    horizontally and vertically.

    I would do this by having a "wrapper" div with

    {
    left: 50%;
    top: 50%;
    margin-top: - [half the height];
    margin-left: - [half the width];
    }

    This works fine, EXCEPT when the browser viewable area is smaller than
    the width or the height of the wrapper. In this case, what I would
    like to happen is that the wrappers sits against the top or the left
    of the viewable area and that a scrollbar helps the user to see the
    parts of the screen that are cut off.....

    In the old days, with tables, you could achieve just this by having a
    table as wrapper. The code goes something like this:

    <table width="100%" height="100%">
    <tr valign="middle" >
    <td align="center">
    inner div with your actual website.....
    </td>
    </tr>
    </table>

    How can I achieve the ideas above without using a table???? or should
    I just use a table.

    Thank you

  • Bergamot

    #2
    Re: having something in the middle of the screen.....

    Ben C wrote:
    >
    position: absolute;
    left: 0; right: 0; top: 0; bottom: 0;
    Note that IE doesn't grok this. IE6 doesn't for sure. I don't know if it
    was fixed in IE7, but I suspect not.

    --
    Berg

    Comment

    • windandwaves

      #3
      Re: having something in the middle of the screen.....

      On Jul 21, 11:31 pm, Bergamot <berga...@visi. comwrote:
      Ben C wrote:
      >
      position: absolute;
      left: 0; right: 0; top: 0; bottom: 0;
      >
      Note that IE doesn't grok this. IE6 doesn't for sure. I don't know if it
      was fixed in IE7, but I suspect not.
      >
      --
      Berg
      Hi,

      Thanks for all your replies. I get the feeling that basically, the
      best solution is to keep using the old table system, because if IE6
      does not support it then you can't really use it yet - right?

      Thank again for all your replies.

      Nicolaas

      Comment

      Working...