how to set margins of children code example
Example 1: css prevent margin collapsing
/* Some CSS Properties that prevent margin collapsing (each of them does) */
float: left;
float: right;
position: absolute;
display: inline-block;
display: flex;
overflow: hidden;
Example 2: css space between child elements
/*
this method will add bottom space but will not apply bottom space in last child
*/
div > *:not(:last-child) {
display: block;
margin-bottom: 30px;
}