css trouble in mozilla

Discussion in 'HTML' started by APT, Feb 8, 2006.

  1. APT

    APT Guest

    Any ideas on using absolute positioning inside a table.

    I gave a table the class:

    table.contain {
    position: relative;
    }

    Then I positioned an image and a box within the table:

    img.web {
    position: absolute;
    top: 118px;
    left : 88px;
    }

    ..box {
    position: absolute;
    top: 110px;
    left : 80px;
    height: 211px;
    width: 276;
    border-width: 1px;
    border-style: dashed;
    border-color: #fff;
    }


    Here are the relevant html bits:

    <table width="800" height="600" border="0" align="center" cellpadding="0"
    cellspacing="0" class="contain">


    <tr>
    <td height="265" background="images/winter_midleft.jpg">

    <div class="box"></div>
    <img src="images/spacer.gif" class="web">
    </div>

    </td>

    It works great in IE. Just how I want it to look.
    But it is all over the place in mozilla.

    Have a look - http://www.hooligandesigns.com/web.php

    Any idea how to get this to work in both???

    Thanks in advance.
    APT, Feb 8, 2006
    #1
    1. Advertising

  2. APT

    APT Guest

    Hmmm...

    I seemed to have figured it out. So if you visited and saw the pages match,
    that's why.

    Turns out Mozilla doens't like:
    <table width="800" height="600" border="0" align="center" cellpadding="0"
    cellspacing="0" class="contain">

    I took out the align="center" and the class="contain" and the put a <div>
    around the whole table to keep things in position.

    Not exactly how I want it to look, but atleast it is consistent.


    "APT" <> wrote in message
    news:...
    > Any ideas on using absolute positioning inside a table.
    >
    > I gave a table the class:
    >
    > table.contain {
    > position: relative;
    > }
    >
    > Then I positioned an image and a box within the table:
    >
    > img.web {
    > position: absolute;
    > top: 118px;
    > left : 88px;
    > }
    >
    > .box {
    > position: absolute;
    > top: 110px;
    > left : 80px;
    > height: 211px;
    > width: 276;
    > border-width: 1px;
    > border-style: dashed;
    > border-color: #fff;
    > }
    >
    >
    > Here are the relevant html bits:
    >
    > <table width="800" height="600" border="0" align="center" cellpadding="0"
    > cellspacing="0" class="contain">
    >
    >
    > <tr>
    > <td height="265" background="images/winter_midleft.jpg">
    >
    > <div class="box"></div>
    > <img src="images/spacer.gif" class="web">
    > </div>
    >
    > </td>
    >
    > It works great in IE. Just how I want it to look.
    > But it is all over the place in mozilla.
    >
    > Have a look - http://www.hooligandesigns.com/web.php
    >
    > Any idea how to get this to work in both???
    >
    > Thanks in advance.
    >
    >
    >
    >
    >
    >
    >
    APT, Feb 8, 2006
    #2
    1. Advertising

  3. APT wrote:

    > Hmmm...
    >
    > I seemed to have figured it out. So if you visited and saw the pages match,
    > that's why.
    >
    > Turns out Mozilla doens't like:
    > <table width="800" height="600" border="0" align="center" cellpadding="0"
    > cellspacing="0" class="contain">
    >
    > I took out the align="center" and the class="contain" and the put a <div>
    > around the whole table to keep things in position.
    >
    > Not exactly how I want it to look, but atleast it is consistent.


    What is your intention, to center the table on the page or center the
    text within the table cells? For the former:

    TABLE.contain { margin-left: auto; margin-right: auto; }

    for the latter:

    TABLE.contain TD { text-align: center; }

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Feb 8, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christopher M. Balz

    CSS MIME type: Is it Tomcat or Mozilla?

    Christopher M. Balz, Sep 11, 2003, in forum: Java
    Replies:
    1
    Views:
    5,412
    Christopher M. Balz
    Sep 11, 2003
  2. David Graham

    Re: CSS positioning help - Mozilla

    David Graham, Jun 28, 2003, in forum: HTML
    Replies:
    1
    Views:
    5,485
    Lorne Cameron
    Jun 28, 2003
  3. brucie
    Replies:
    8
    Views:
    1,994
    Wipkip
    Jun 29, 2003
  4. Henri
    Replies:
    9
    Views:
    1,815
    Toby Inkster
    Feb 22, 2005
  5. mr_burns

    trouble using mozilla xml loading code

    mr_burns, Jan 6, 2005, in forum: Javascript
    Replies:
    1
    Views:
    175
    Martin Honnen
    Jan 6, 2005
Loading...

Share This Page