Home > Web Front-end > CSS Tutorial > The difference between border, margin and padding properties_CSS/HTML

The difference between border, margin and padding properties_CSS/HTML

WBOY
Release: 2016-05-16 12:11:28
Original
2643 people have browsed it

The border attribute (border) is used to set the edge of an element.
The margin attribute (margin) is used to set the distance between the edge of the space occupied by an element and adjacent elements.
The gap attribute (padding) is used to set the distance from the element content to the element boundary.
These three attributes all belong to the box type attributes in CSS.

The diagram below vividly reflects the differences between the three.

Here is a 3D schematic diagram of the box model, I hope it will be easier for you to understand and remember.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template