Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Sep 2005
    Posts
    10
    Member #
    11205
    hi !

    This is a very simple splash page.
    Everything works fine, except that the table with the id "main_table" doesn't align to the center in firefox and netscape. Can anyone tell me why !

    I am including text for the html and CSS file, in order to view place the CSS file in a folder called "images" and name the file "styles.css"


    HTML FILE
    ------------------------------------------------------------

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>AREA194 DESIGN STUDIOS</title>
    <meta name="description" content="AREA194 Design Studios is an emerging leader in Website and Graphics design. Our services include web site development, design, multimedia, broadcast video, 3D, animation and corporate identity." />
    <meta name="keywords" content="Macromedia Flash, best flash design, web design, website, broadcast flash, design studio, html design, development, new media, applications, broadcast video, 3D, animation, graphics, print, development, flash developer, quicktime, top studio, best design, web site design, killer flash, cool design, interface design, multimedia, motion graphics, corporate identity, branding, online marketing, web strategy" />
    <link href="images/styles.css" rel="stylesheet" type="text/css" media="screen" />
    <script type="text/JavaScript">
    <!--
    function MM_swapImgRestore() { //v3.0
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }

    function MM_preloadImages() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }

    function MM_findObj(n, d) { //v4.01
    var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
    }

    function MM_swapImage() { //v3.0
    var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }
    //-->
    </script>
    </head>

    <body onload="MM_preloadImages('images/splash_enter_01_up.gif','images/splash_enter_02_up.gif')">
    <table id="case" border="1">
    <tr>
    <td>&nbsp;</td>
    <td><table id="main_table">
    <tr>
    <td><img src="images/splash_logo.gif" alt="Company Logo" width="206" height="143" /></td>
    </tr>
    <tr>
    <td><table id="table_01" border="1">
    <tr>
    <td><div id="roll_01"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('splash_roll_01','','ima ges/splash_enter_01_up.gif',1)"><img src="images/splash_enter_01_over.gif" alt="Click to enter with Flash enabled" name="splash_roll_01" width="206" height="48" border="0" id="splash_roll_01" /></a></div></td>
    <td><div id="roll_02"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('splash_roll_02','','ima ges/splash_enter_02_up.gif',1)"><img src="images/splash_enter_02_over.gif" alt="Click to enter without flash" name="roll_02" width="206" height="48" border="0" id="splash_roll_02" /></a></div></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td><img src="images/splash_copyright.gif" alt=" 2005 copyright picture" width="206" height="34" /></td>
    </tr>
    </table></td>
    <td>&nbsp;</td>
    </tr>
    </table>

    </body>
    </html>

    --------------------------------------------------------------------


    CSS FILE

    ---------------------------------------------------------------------

    body {
    background-color: #2A0000;
    background-image: none;
    }
    #case {
    width: 100%;
    text-align: center;
    position: absolute;
    left: 0px;
    top: 15%;
    }
    #case #main_table {
    text-align: center;
    width: 600px;
    }
    #case #main_table #table_01 {
    text-align: center;
    width: 100%;
    }
    #case #main_table #table_01 #roll_01 {
    text-align: left;
    }
    #case #main_table #table_01 #roll_02 {
    text-align: right;
    }

    -----------------------------------------------------------------------

  2.  

  3. #2
    Senior Member audiofreak9's Avatar
    Join Date
    Apr 2005
    Location
    NJ
    Posts
    339
    Member #
    9584
    Add the following to the css of the element you want to center:
    Code:
    margin:0 auto;

  4. #3
    Senior Member Rince's Avatar
    Join Date
    Nov 2004
    Posts
    183
    Member #
    8318
    This will center your table.

    #case #main_table {
    margin:0 auto;
    width: 600px;
    }

    But there is no need for the #case #main_table #table_01 #roll_01 {... Just using #roll_01 is enough cause the id is unique anyway, you don't have to list it's entire parentage.

    Also, go easy on the tables. Three tables nested inside each other and none of them actually do very much. You could simplify that code quite a bit.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:27 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com