@adhikariprayag
Posted
It seems you are confused about padding and margin. They are completely different from each other and understanding them is a must in CSS. To put it simply, the margin - shifts the position, and padding - adds an inner area. This is just a simple description and it's not fully true, so, I suggest you learn in-depth about them through YouTube tutorials or websites.
Also, I would suggest you make use of the "Inspect" element of your browser to see how they work. Hope this was helpful.