@fernandolapaz
Posted
Hi! regarding your question,
It just happens that the margin doesn't affect the position of the child relative to its parent, unless the parent has padding (or something else like border), that's normal behavior.
You can try adding a "padding-top: 1px" to the body for example (which could be counteracted with "margin-top: -1px" if you want), or use "border-top: 1px solid transparent", etc.
In any case, I would be inclined to perform these spacing using padding on the parent instead of margin on the child. I'd say it's best practice, although you can find out more about it.
Using overflow is another option as you say.
I hope it's useful. 👍
Cheers!
If this helped you please MARK IT AS HELPFUL 😀
Marked as helpful
@chucksterv
Posted
@fernandolapaz Hey mate, that's a bunch for your response. I will definitely try that. Cheers!