SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Padding problem

  1. #1
    SitePoint Addict o~~Goatee~~o's Avatar
    Join Date
    Jan 2004
    Location
    North Yorkshire UK
    Posts
    350
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Padding problem

    Hi there

    Could someone please help figure out why the padding at the bottom of my page is different to the top and sides? Heres the page:

    http://homepage.ntlworld.com/mr.wint...cene/index.htm

    You will notice that the white border (outabox) is bigger at the bottom. Any ideas why it does this? Heres the CSS:

    http://homepage.ntlworld.com/mr.wint...scene/main.css

    Many thanks

    PS. Any general comments on the page and code would also be much appreciated

  2. #2
    SitePoint Evangelist ClevaTreva's Avatar
    Join Date
    Jan 2004
    Location
    Chipping Campden, UK
    Posts
    403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi

    That's a nice site. Did I say that before? Well it is.

    Change the margin on the padding for the bottom-box to :

    padding: 0px auto auto;

    from:

    padding: 0px auto;

    Otherwise you have a margin of 5px under it, then the padding for the outabox.




    Trevor
    PS, always put the units in even for 0 values!

  3. #3
    SitePoint Addict o~~Goatee~~o's Avatar
    Join Date
    Jan 2004
    Location
    North Yorkshire UK
    Posts
    350
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi ClevaTreva

    You've saved me again, works perfectly, thank you It always seems to be one little thing that stops me.

    Could you please explain the purpose of auto - how, why and when it should be used? Any info would be much appreciated

    And yes, you mentioned the site before Glad you like it. Hopefully I'll get the go ahead to start working on the content this week.

    Cheers

  4. #4
    SitePoint Evangelist ClevaTreva's Avatar
    Join Date
    Jan 2004
    Location
    Chipping Campden, UK
    Posts
    403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by o~~Goatee~~o
    Hi ClevaTreva

    You've saved me again, works perfectly, thank you It always seems to be one little thing that stops me.

    Could you please explain the purpose of auto - how, why and when it should be used? Any info would be much appreciated

    And yes, you mentioned the site before Glad you like it. Hopefully I'll get the go ahead to start working on the content this week.

    Cheers
    Hi

    You can put 1, 2, 3 or 4 values in styles like margin like so:

    margin: 1 (all 4 sides)
    margin: 1 (top + bot) 2 (left + right)
    margin: 1 (top) 2 (left + right) 3 (bottom)
    margin: 1 (top) 2 (right) 3 (bot) 4 (left)

    auto sorts of adds padding to make the page width or height fit. So auto left and right will put equal amounts of margin around the object to make it central.

    Rather than put 0px for bottom, I often put auto there too.

    Your margin might also have worked as

    margin: 5px auto 0px;




    Trevor

  5. #5
    SitePoint Addict o~~Goatee~~o's Avatar
    Join Date
    Jan 2004
    Location
    North Yorkshire UK
    Posts
    350
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your help m8ey, its much appreciated

    The trouble with learning all the time though is that I'm never happy with the result. I create something and think "Great, I'm happy with that", and then I learn something new and therefore go back and change it again. I'll have to stop sometime.

    Cheers


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
  •