We take div as a box example, since and show the life of the box, then we think about the life of the box
The interior is not empty good for storing things, and inside the area of storage we give him a name called "Content (internal
", and the paper wall of the box gives him a name called" Border (border) ", if something inside the box is like a hard
Disk, but the hard drive is afraid of vibration, so we need to evenly fill some of the shock-proof material inside the hard drive's surrounding box,
The frame of the hard disk and the box has a certain distance, we call this part distance is called "padding (padding)", if
We need to buy a lot of hard drives, or because the hard drive is afraid of vibration, need some shock between the box and the box
Material to fill, then the distance between the box and the box we call "margin (margin)"
Good drop! The four elements of the box model are: content, border (border),
Padding (inner margin), margin (margin), such as
Our pages are made up of dozens of boxes, but unlike real-life boxes, real-life
We'll ignore margin, but in the page we can't ignore margin, only the
The box model that includes the margin is complete in CSS, and when the margin is zero, let's not ignore it, and know that he
Is there.
The content comes from the watercress's sails
The difference between margin and padding in HTML