add margin top only if there is content above code example
Example: 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;