We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11413
    • 203 Posts
    Hi,

    I’m currently struggling with something i already did but seem to have been broken in firefox.... how to center a background in a <body> on the screen? usually :

    body {
    background: url('thing.jpg') center center no-repeat;
    }


    was enough. In IE it’s ok, but in firefox no...

    Also, I want to center a <div> on the screen so it fits in the middle of the <body>’s background. I used something like :

    #
    container {
    display: block;
    height: 361px;
    width: 361px; 
    margin: auto;
    }


    and it dont work (it’s centered only horizontally... both in IE and FF)

    here is my webpage structure :

    <body> 
    <div id="container">
    <nav>
    etc.
    </nav>
    etc.
    </div>
    </body>


    how could I fix it?

    thanks in advance,

    Blaise
      Blaise Bernier

      www.medialdesign.com - Solutions for small business, hosting, design and more!
      • 11413
      • 203 Posts
      Good tutorial here :

      http://www.quirksmode.org/css/centering.html

      100% CSS with no tables.
        Blaise Bernier

        www.medialdesign.com - Solutions for small business, hosting, design and more!