Home  >  Article  >  Web Front-end  >  What are the properties for setting element margins in css3

What are the properties for setting element margins in css3

青灯夜游
青灯夜游Original
2021-12-15 17:11:103365browse

The attributes for setting element margins include: margin, margin-bottom, margin-left, margin-right, margin-top, padding, padding-bottom, padding-left, padding-right, etc.

What are the properties for setting element margins in css3

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

In CSS3, there are two properties for setting element margins:

  • Margin property

  • Padding properties

Margin properties

##PropertiesInstructionsmarginSet all margin properties in one declarationmargin-bottomSet the bottom margin of the elementmargin-leftSet the left margin of the elementmargin- rightSet the right margin of the elementmargin-topSet the top margin of the element

Padding attribute

AttributeDescriptionpaddingSet all padding properties in one declarationpadding-bottomSet the bottom padding of an elementpadding-leftSet the left padding of the elementpadding-rightSet the right padding of the elementpadding-topSet the top padding of the element
(Learning video sharing:

css video tutorial

The above is the detailed content of What are the properties for setting element margins in css3. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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