{"action":"opened","issue":{"url":"https://api.github.com/repos/gdutwyg/frontEnd-notes/issues/6","repository_url":"https://api.github.com/repos/gdutwyg/frontEnd-notes","labels_url":"https://api.github.com/repos/gdutwyg/frontEnd-notes/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/gdutwyg/frontEnd-notes/issues/6/comments","events_url":"https://api.github.com/repos/gdutwyg/frontEnd-notes/issues/6/events","html_url":"https://github.com/gdutwyg/frontEnd-notes/issues/6","id":337269021,"node_id":"MDU6SXNzdWUzMzcyNjkwMjE=","number":6,"title":"margin collapse(外边距塌陷)解决方案","user":{"login":"gdutwyg","id":11848087,"node_id":"MDQ6VXNlcjExODQ4MDg3","avatar_url":"https://avatars3.githubusercontent.com/u/11848087?v=4","gravatar_id":"","url":"https://api.github.com/users/gdutwyg","html_url":"https://github.com/gdutwyg","followers_url":"https://api.github.com/users/gdutwyg/followers","following_url":"https://api.github.com/users/gdutwyg/following{/other_user}","gists_url":"https://api.github.com/users/gdutwyg/gists{/gist_id}","starred_url":"https://api.github.com/users/gdutwyg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdutwyg/subscriptions","organizations_url":"https://api.github.com/users/gdutwyg/orgs","repos_url":"https://api.github.com/users/gdutwyg/repos","events_url":"https://api.github.com/users/gdutwyg/events{/privacy}","received_events_url":"https://api.github.com/users/gdutwyg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-01T06:58:46Z","updated_at":"2018-07-01T06:58:46Z","closed_at":null,"author_association":"OWNER","body":"### 父子元素margin collapse(外边距塌陷)\r\n解决的方法有三种：\r\n* 给父元素设置一个边框，当然可以设置边框为透明;\r\n* 为父元素添加padding；\r\n* 为父元素设置overflow:hidden;\r\n\r\n[demo地址](https://codepen.io/anon/pen/JZamKO)\r\n\r\n### 兄弟元素margin collapse(margin 取两者最大值)\r\n解决方法：\r\n* 绝对定位元素\r\n* float元素\r\n* inline-box元素\r\n* overflow : hidden\r\n\r\n这些不会和垂直方向上的其他元素margin折叠–其实就是可以生成新的BFC\r\n\r\n[BFC](http://www.cnblogs.com/lhb25/p/inside-block-formatting-ontext.html)\r\n"}}
{"actor":{"display_login":"gdutwyg"}}