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 5 of 5
  1. #1
    Regular Coder noneforit's Avatar
    Join Date
    Apr 2009
    Location
    England
    Posts
    268
    Thanks
    10
    Thanked 20 Times in 20 Posts

    Website centred in IE but not firefox?

    Hello

    For once its a firefox issue and not IE!

    I have a website that centres in IE but not firefox.


    www.noneforit.com/marie/index.html

    The #wrapper div id set to margin: o auto and the width is width:80%

    Any ideas

    Thanks

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Code:
    #inner {/*Main.css (line 17)*/
    border:3px solid #000000;
    height:930px;
    margin:auto;
    /*width:950px;*/
    }
    #header {/*Main.css (line 24)*/
    background-image:url(images/Header2.jpg);
    background-position:center;
    background-repeat:no-repeat;
    border-bottom:3px solid #000000;
    height:140px;
    /*width:950px;*/
    }
    In short, you don't have to explicitly apply the width to an inner block level element, if it's supposed to stretch inside its container element.

    I'd recommend you to check http://bonrouge.com/2c-hf-fluid.php, to see how to make a good 2 column fluid layout (you may set a width:80%; to the #wrap in that layout).
    Last edited by abduraooft; 05-28-2009 at 01:32 PM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Regular Coder noneforit's Avatar
    Join Date
    Apr 2009
    Location
    England
    Posts
    268
    Thanks
    10
    Thanked 20 Times in 20 Posts
    Thanks for the quick reply

    So If i just put Width: auto; to the header and inner div tags then it should centre in firefox?

    Thanks

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Just get rid of the widths. 950px can sometimes be wider than 80% which was the width in your #wrapper. Also I wouldn't set heights on #inner, or #wrapper. If you add overflow:hidden; to the CSS #inner your background image will adjust to the height of the content just in case the content gets larger you won't have to keep setting widths.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Quote Originally Posted by Hussein Ali View Post
    Hi ,

    Try to use <center> , </center> !!
    Umm..no do not use the center element. Its been deprecated for a while.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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