What is the difference between margin and padding in CSS?
I’m learning CSS and I often hear about margin and padding, but I’m a bit confused about their differences. I understand that both affect spacing, but how do they each work? Specifically, how do margin and padding affect the layout and spacing of elements? Could someone explain the difference between them with simple examples or visuals?