margin 50px auto doesn't work in bottom

Discussion in 'CSS' started by bondigor69, Dec 17, 2013.

  1. #1
    hey guys I set margin:50px auto for body and there's only margin on top the bottom doesn't work. I can't find the problem.

    http://giantgag.com/gags/so-i-heard-you-like-bad-boys-compilation?pid=2184

    Also when the screen resolution is smaller the right container goes under the main content but there's still a gap on right. why it does that ?
     
    Last edited: Dec 17, 2013
    bondigor69, Dec 17, 2013 IP
  2. Ankur Dubey

    Ankur Dubey Greenhorn

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #2
    your site looking perfect in my google chrome??

    i think you should clear cache you and delete the cookies from your browser.

    and yeah 1 suggestion in last next and previous your rounded images are awesome but try to insert that images in hover effect when someone mouse over on that ext and previous arrow.

    then they looks awesome unique too :)
     
    Ankur Dubey, Dec 17, 2013 IP
  3. wiicker95

    wiicker95 Well-Known Member

    Messages:
    438
    Likes Received:
    37
    Best Answers:
    10
    Trophy Points:
    100
    #3
    Everything "works" in CSS, just not necessarily the way you want it.
    1st problem: do this instead:
    .post {
    margin-bottom:50px;
    }

    2nd problem: well that's just normal behavior. You can't expect it to go all the way since your container widths are all fixed multiple times (300px,350px, 800px etc). You try to make it responsive with media queries, but it isn't even built fluid in the first place.

    If I were you, I would ditch that markup completely and write a new one. It's really poorly written, and you'll encounter more and more problems along the way and add more and more css fixes which will then break your layout eventually.
     
    wiicker95, Dec 17, 2013 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #4
    Margin collapses outside body getting cut off in a lot of layouts -- that's why I would use padding on body instead of margin on it's child. Whenever margin doesn't do what you want, use padding on the parent instead! Just common sense.

    Though wiicker95 is right, that page is a wreck that really should be done over from scratch. DIV for nothing, static scripting inlined in the markup, onevent script attributes that really have no place on a modern site (as they should auto-attach after the markup), static CSS in the markup, classes for nothing if you understand inheritance, little if anything remotely resembling semantics...

    Admittedly, it's turdpress, so much of that is just par for the course... doesn't make it right.
     
    deathshadow, Dec 18, 2013 IP
  5. bondigor69

    bondigor69 Greenhorn

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    18
    #5
    Please clarify I'm not sure about what you say.
     
    bondigor69, Dec 18, 2013 IP