Prevent margin collapsing


/ Published in: CSS
Save to your folder(s)

Actually this is very well known. Just added it cause I always forget this.


Copy this code and paste it in your HTML
  1. <div id="top">
  2. <div id="bottom">
  3.  
  4. add to css:
  5.  
  6. top {
  7. overflow: hidden;
  8. or overflow: auto;
  9. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.