Activity Stream
48,167 MEMBERS
6731 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 7 of 7
  1.     
    #1
    Member
    Website's:
    scifi-world.org scifiw.com

    Default How do i align my webpage to the center?

    Hi,

    I'm working on a new site and I want to center align the whole page.

    I use margin:0 auto; in my css file and it works with firefox and chrome, but in IE9 the whole page is aligned to the left.

    Thanks for any help.
    dtommy79 Reviewed by dtommy79 on . How do i align my webpage to the center? Hi, I'm working on a new site and I want to center align the whole page. I use margin:0 auto; in my css file and it works with firefox and chrome, but in IE9 the whole page is aligned to the left. Thanks for any help. Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Can this help:

    <CENTER> CONTENT GOES HERE </CENTER>

    or

    <DIV ALIGN=CENTER> CONTENT GOES HERE </DIV>
    Selling cheap domains - 5 dollars each - Payment with PayPal only

  4.     
    #3
    Respected Developer
    Website's:
    wrzc.org
    Don't use the above. It's not good practice. Use margin auto so it's something like the following in your CSS
    PHP Code: 
    .something {margin:0 auto;display:block;} 
    And your html would be like this:
    PHP Code: 
    <div class="something">Text goes here</div
    Tutorial How to SEO your Warez Site a guide to help you increase your organic traffic

    Huge list of Warez Sites and free Multiposter Templates

  5.     
    #4
    Pure Awesomeness!
    Thanks for that Happy.



  6.     
    #5
    Member
    Probably because you have not set a DOCTYPE, IE is rendering the page in Quirks Mode and not recognizing "margin: 0 auto".
    Add this at the beginning of your html document "<!DOCTYPE html>".

  7.     
    #6
    Member
    I use to set the wrapper element with:

    margin-left: auto;
    margin-right: auto;

  8.     
    #7
    Member
    Website's:
    RahulParekh.in DevilGang.in WhatsInADesign.com
    Quote Originally Posted by dtommy79 View Post
    Hi,

    I'm working on a new site and I want to center align the whole page.

    I use margin:0 auto; in my css file and it works with firefox and chrome, but in IE9 the whole page is aligned to the left.

    Thanks for any help.
    Do you have comments above the doctype? If you do, pages break completely in IE.

    If you don't have a doctype, you need one. use xhtml 1.0 strict or html5 doctype.

    More on doctype over here:
    http://www.alistapart.com/articles/doctype/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [HTML] How To Align Any Image Center !
    By Rapid S in forum Web Development Area
    Replies: 28
    Last Post: 9th Sep 2012, 11:55 AM
  2. [Help] Align Images to center in CSS
    By coolboyz2323 in forum Technical Help Desk Support
    Replies: 11
    Last Post: 5th Feb 2012, 04:14 PM
  3. How to align child categories in center?
    By DuckBre in forum Web Development Area
    Replies: 3
    Last Post: 3rd Feb 2012, 07:42 PM
  4. How to center align ads..?
    By Hatefed in forum vBulletin
    Replies: 3
    Last Post: 9th Nov 2010, 03:13 PM
  5. Center webpage with absolute positions?
    By iL < in forum Technical Help Desk Support
    Replies: 8
    Last Post: 14th Apr 2010, 08:04 PM

Tags for this Thread

BE SOCIAL