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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Center align entire webpage

    Hi

    For some reason, my website won't align in the center on all browsers. Seems to be an issue is IE and also on IOS browsers
    http://poppyandpaige.com/blog/
    Any ideas would be most appreciated!

    Thanks
    Mark

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,310
    Thanks
    203
    Thanked 2,563 Times in 2,541 Posts
    Seems OK in IE9. Try

    * { text-align:center;}


    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    New Coder
    Join Date
    Aug 2012
    Location
    Kalamazoo, MI
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah it looks good to me in Firefox, Chrome, and IE9. However if you are trying to center align the text, Philip's answer above me will do just fine. Add that to the body selector in your CSS. If you are trying to center align your content box, add this to your content box css:

    Code:
    margin: 0 auto;
    that will auto align your left and right sides, centering your content to the middle. The 0 in front of "auto" is for the top and bottom margins, you can change this if you would like.

  • #4
    Regular Coder
    Join Date
    Jul 2012
    Location
    London
    Posts
    473
    Thanks
    4
    Thanked 86 Times in 86 Posts
    Quote Originally Posted by TylerB View Post
    Yeah it looks good to me in Firefox, Chrome, and IE9. However if you are trying to center align the text, Philip's answer above me will do just fine. Add that to the body selector in your CSS. If you are trying to center align your content box, add this to your content box css:

    Code:
    margin: 0 auto;
    that will auto align your left and right sides, centering your content to the middle. The 0 in front of "auto" is for the top and bottom margins, you can change this if you would like.
    Code:
    margin:0 auto;
    Won't work unless his got a width above 800


  •  

    Tags for this Thread

    Posting Permissions

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