Margins, padding and border

Just finished the Cafe Menu and I don’t understand margins, padding and border. Is there any good in depth guide why, where and how to use it? Thanks

You can look all of these up individually or look for articles that compare them.
Eg < CSS Box Model>

In general though
A border is when you add some sort of edging to the element.
A margin is when you add spaces to the outside of the element (around the border)
A padding is when you add to the width and height of the element within its borders.

So kind of like if the element is a house. A border is a fence. Padding is like making your house bigger. Margin is making the spaces around the fence wider so the land is bigger.