I'm having some trouble understanding margins so I hope you can provide some help.
I have the following code:
According to what I understand, the space between two elements is determined by their margin. So right now, the span "Pablo" is on top of the word "below". "pablo" has some padding so the bottom part of its border is almost touching "below".
<p><span id="p">Pablo</span> <span id="g">Gonzalez</span></p>
As you can see, "pablo" has a lot of bottom margin, but no matter how much margin I add, its border continues to be right on top of below. I expected for a white space to be created between "pablo" and "below" but that's not that case.
If I then add some top margin to "below", then I get the expected result. So, I understand that the space between them is a combination of their margins (correct me if I'm wrong) but why doesn't "pablo"s bottom margin affect the space between them like "below"s top margin does?
I appreciate any help!