SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jan 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Divs in footer not centered :/

    Hey,

    I want that divs, which are in footer div "apacia" appear not in left, but in the center of the page, tried align: center; or text-align: center; in parent div's but didin't helped.

    Url: http://siauliaicity.lt/sokoladine%202/

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,173
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Change this

    Code:
    #aphold {
      height: 168px;
      margin: 10px 0 0;
      padding: 0;
      width: 778px;
    }
    to this

    Code:
    #aphold {
      height: 168px;
      margin: 10px auto 0;
      padding: 0;
      width: 778px;
    }

  3. #3
    SitePoint Member
    Join Date
    Jan 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for helping!

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,173
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    You're welcome.

    I should have explained that if you want to center a block level element (like a div etc.) you need to give it a width (which you had) and then set its left and right margins to "auto". So what you've ended up with is:

    margin: 10px auto 0 auto
    (top, right, bottom, left)

    Those autos are for right and left, but the last one (for left) doesn't need to be written, because if left out, it's assumed to be the same as the right margin.

  5. #5
    SitePoint Member
    Join Date
    Aug 2011
    Location
    Vermont, USA
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just see the post but Ralph provided a correct code.
    website design, website round up, freebies http://coder-design.com/


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
  •