SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Non-Member
    Join Date
    Sep 2007
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Centered Resizing Div

    Hello,

    What is the code that enables the website CrazyEgg.com to remain centered whilst the browser window is resized?

    Dysan

  2. #2
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Wrap the entire page in a div called #wrap, and give it whatever width properties suit you. (a fixed value, a percentage or whatever)

    Then body {
    text-align:center;
    }
    #wrap {
    width: you decide;
    text-align:left;
    margin:auto
    }

    Remember that if you use a min-width, max-width combination you'll need an IE conditional statement as well to cover all versions.


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
  •