Cannot centre page in firefox browser ( it works in Internet Explorer)

Discussion in 'HTML' started by Bundy, Nov 19, 2006.

  1. Bundy

    Bundy Guest

    Hi

    I cannot centre the following page in firefox browser. It does work in
    internet explorer.

    CSS (in external file - testcssglobal.css)

    body {
    text-align: center;
    margin: 0px;
    padding: 0px;

    }

    #global {
    position: relative;
    width: 800px;
    text-align: left;
    }

    HTML
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>testing css</title>
    <link href="css/testcssglobal.css" rel="stylesheet" type="text/css" />
    </head>

    <body>
    <div id="global">
    <table width="800" border="10">
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    </table>

    </div>
    </body>
    </html>

    Your help will be appreciated.

    Regards

    Bundy
     
    Bundy, Nov 19, 2006
    #1
    1. Advertising

  2. Bundy

    dorayme Guest

    Re: Cannot centre page in firefox browser ( it works in Internet Explorer )

    In article <4560e073$0$5589$>,
    Bundy <> wrote:

    > Hi
    >
    > I cannot centre the following page in firefox browser. It does work in
    > internet explorer.
    >
    > CSS (in external file - testcssglobal.css)
    >
    > body {
    > text-align: center;
    > margin: 0px;
    > padding: 0px;
    >
    > }
    >
    > #global {
    > position: relative;
    > width: 800px;
    > text-align: left;
    > }



    Try instead of all the above:

    body {margin:0;padding:0;}

    table {margin:auto;}


    (given your html... thought better to put the styles for the
    table in the css...)

    --
    dorayme
     
    dorayme, Nov 20, 2006
    #2
    1. Advertising

  3. Bundy

    dorayme Guest

    Re: Cannot centre page in firefox browser ( it works in Internet Explorer )

    In article
    <>,
    dorayme <> wrote:


    >
    > thought better to put the styles for the
    > table in the css...)


    should read "though better"

    --
    dorayme
     
    dorayme, Nov 20, 2006
    #3
  4. Bundy

    Bundy Guest

    [SOLVED]

    Works.

    Thank you

    Bundy
     
    Bundy, Nov 20, 2006
    #4
  5. Bundy

    dorayme Guest

    Re: [SOLVED]

    In article <456110a0$0$6604$>,
    Bundy <> wrote:

    > Works.
    >
    > Thank you
    >
    > Bundy


    I am glad to have helped. Any other problems?

    --
    dorayme
     
    dorayme, Nov 20, 2006
    #5
    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. cmay
    Replies:
    0
    Views:
    1,136
  2. Replies:
    4
    Views:
    5,393
    Jonathan N. Little
    Dec 5, 2005
  3. JDeats
    Replies:
    2
    Views:
    580
    JDeats
    Sep 11, 2007
  4. John Smith
    Replies:
    1
    Views:
    146
    Evertjan.
    Mar 12, 2005
  5. Replies:
    3
    Views:
    104
Loading...

Share This Page