Home  >  Article  >  Web Front-end  >  What does margin in css mean?

What does margin in css mean?

王林
王林Original
2020-11-20 14:15:4219762browse

Margin in css is the margin attribute, which is used to define the space around the element. The margin element can change the top, bottom, left, and right margins of the element individually, or it can change all attributes at once, such as [margin-top:100px; margin-bottom:100px;].

What does margin in css mean?

margin is the margin attribute that defines the space around an element.

(Learning video sharing: css video tutorial)

margin clears the surrounding (outer border) element area. The margin has no background color and is completely transparent.

margin You can change the top, bottom, left, and right margins of the element individually, or you can change all attributes at once.

What does margin in css mean?

Possible values:

  • auto Set the browser margins.
    The result of this will depend on the browser

  • length Define a fixed margin (using pixels, pt, em, etc.)

  • % Define a margin using percentage

Example:

Specify different margins for different sides

margin-top:100px;
margin-bottom:100px;
margin-right:50px;
margin-left:50px;

Related recommendations: CSS Tutorial

The above is the detailed content of What does margin in css mean?. 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