W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2018

Re: [csswg-drafts] [css- not sure] child-contain: border-box; to resolve child margins at parents edge

From: jonjohnjohnson via GitHub <sysbot+gh@w3.org>
Date: Thu, 26 Jul 2018 01:23:37 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-407946141-1532568216-sysbot+gh@w3.org>
Would using `display: flow-root` on the parent solve most your cases? This inhibits margin collapsing between itself and it's children. Either that and/or using...

```
.parent > :first-child { margin-top: 0; }
.parent > :last-child { margin-bottom: 0; }
```
...usually covers all cases for me.

-- 
GitHub Notification of comment by jonjohnjohnson
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2848#issuecomment-407946141 using your GitHub account
Received on Thursday, 26 July 2018 01:23:41 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 26 July 2018 01:23:44 UTC