Results 1 to 6 of 6

Thread: Why some of css doesn't work in IE?

  1. #1
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default Why some of css doesn't work in IE?

    Hi,

    What commands of css are not working in IE? And how we can change them?

    My webpage is floated: center, but in IE it still appears in left... Firefox and Opera shows it without any problems.

  2. #2
    Join Date
    Sep 2008
    Location
    Seattle, WA
    Posts
    135
    Thanks
    1
    Thanked 11 Times in 11 Posts

    Default

    The reason may be that there is no float: center; It's either left or right. If you want to center your page in the middle of the browser use this:

    body {
    margin: auto;
    padding: 0;
    }

    Then a wrapper div :

    #wrapper {
    width: 900px;
    margin: auto;
    padding: 0;
    }

  3. The Following User Says Thank You to simcomedia For This Useful Post:

    auriaks (02-25-2010)

  4. #3
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    An d why do I need wrapper?

  5. #4
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    works great

  6. #5
    Join Date
    Sep 2008
    Location
    Seattle, WA
    Posts
    135
    Thanks
    1
    Thanked 11 Times in 11 Posts

    Default

    I think you just answered your own question of why...

    But, to further that, a wrapper is just a convenient way to apply centering to one element instead of all your elements. Plus, it's an easier way to make it cross-browser compatible. However, for older versions of IE (notably IE6) the old method was to 'trick' IE into centering your page by using:

    body {
    text-align: center;
    }

    #wrapper {
    text-align: left;
    }

    Which centered the wrapper but within the wrapper the text would align left as normal.

  7. #6
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    thanks for info.

Bookmarks

Posting Permissions

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