Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2007
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    centering tables that include divs

    I cant seem to find the solution anywhere but I am making a layout in which I made a centered table that the website sits in. If I position the divs absolute they don't stay in the table but move according to size of browser. How do I get the divs to stay stuck in their part of the table regardless of browser size?

  • #2
    Regular Coder
    Join Date
    Dec 2005
    Location
    Ohio
    Posts
    286
    Thanks
    7
    Thanked 9 Times in 9 Posts
    Is the table absolutely necessary? You should be able to take the divs out of the table and position them precisely where you want using CSS.

    Can you post some of your code so we can see what you are doing?

  • #3
    New Coder
    Join Date
    Sep 2007
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is the code as is. The problem is I want the divs absolute WITHIN the table so the whole late centers itself. the way I've done it the table centers itself and the divs stay where they were. I am unsure how to fix this.

    <html><head><title>EU</title>
    <link rel="SHORTCUT ICON" href="icon.ico">
    <link href="winter.css" rel="stylesheet" type="text/css">
    </head>

    <body leftmargin="0" topmargin="5">
    <center><table border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td><img src="images/winterlayout.jpg" usemap="#winterlayout_01_Map" border="0"></td>
    </tr>
    </table></center>
    <map name="winterlayout_01_Map">
    <area shape="rect" alt="" coords="687,101,727,113" href="#">
    <area shape="rect" alt="" coords="576,101,670,113" href="#">
    <area shape="rect" alt="" coords="510,101,560,113" href="#">
    <area shape="rect" alt="" coords="422,101,493,113" href="#">
    <area shape="rect" alt="" coords="320,101,404,112" href="#">
    <area shape="rect" alt="" coords="203,101,302,113" href="#">
    </map>
    <div id="layer1" style=" color: #8b687d; font-size: 12pt; font-family: arial, helvetica, sans-serif; visibility: visible; display: block; position: relative; z-index: 1; top: 120px; left: 190px; width: 620px; height: 460px;">
    <iframe src="frame.html" name="frame" border="0" frameborder="0" height="460" width="620"></iframe>
    </div>
    <div id="layer2" style="position: absolute; top: 400px; left: 24px; width: 201px; height: 130px; z-index: 1;"><iframe src="nav.html"></iframe></div>
    <div id="layer3" class="disclaimer" style="position: absolute; top: 580px; left: 300px; width: 459px; height: 40px; z-index: 1; text-align: center;"></div>
    </body></html>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •