I’m trying to use margin to crate a gap between my outer div and inner div at the top. However, when I set margin-top to anything it creates a margin outside the outer div instead. I’ve attached an image to hopefully make this clearer. The first image is what I get when I’ve tried to use margin-top and the second is what I was aiming for.
#timer-div{
height : 70%;
background-color : red;
}
#timer-circle {
background-color : blue;
margin : 5% 25%;
width : 50%;
}
I can solve this by using padding-top on #timer-div instead of #timer-circle but I want to understand why margin-top on #timer-circle doesn’t work.
Thanks!