SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Non-Member
    Join Date
    Aug 2007
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Centre Div (Vertically & Horizontally)

    Hi Folks,

    Whats the simplest way to centre a div vertically & horizontally?

    TicTac

  2. #2
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think this...
    Code:
    position:absolute;
    top:50%; left:50%;

  3. #3
    SitePoint Addict
    Join Date
    Sep 2001
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that will only set the upper left corner in the middle of the page. to center horizontally you use "margin-left:auto; margin-right:auto" and set the width of it. not sure how to center vertically.
    Steve Davis


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
  •