Search Results

Search found 1 results on 1 pages for 'johntrepreneur'.

Page 1/1 | 1 

  • Should the spacing between parent and child containers belong to parent or child?

    - by johntrepreneur
    I'm struggling to determine where in my CSS the padding/margins should go to keep seperation between parent and child containers. For example, if you have have a parent div with two nested children and you need to have even 10px spacing between the children and also have the children be spaced 10 px from the parent; then would you add padding to parent div {padding:10px} and then just add 10px of margin between the children? Or would you leave the parent at 0 padding and have the children define what seperation they need from each other and also their parents?

    Read the article

1