In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Today, I would like to talk to you about the meaning of margin, many people may not know much about it. In order to make you understand better, the editor summed up the following content for you. I hope you can get something according to this article.
Let's focus on the use of the CSS margin attribute, which sets the width of all outer margins of an element, or sets the width of the outer margins of each edge.
CSS margin attribute
Define
The margin property is an abbreviated property used to set all four outer margins in a declaration.
Note: negative values are allowed.
Inheritance: No
Description
This shorthand property sets the width of all the outer margins of an element, or sets the width of the outer margins on each side.
The vertical adjacent outer margins of block-level elements are merged, while inline elements do not actually occupy the upper and lower outer margins. The left and right margins of inline elements are not merged. Similarly, the outer margins of floating elements are not merged. A negative margin value is allowed, but be careful when using it.
JavaScript syntax
The CSS attribute can also be changed dynamically through a JavaScript.
Script syntax:
Object.style.margin= "100px"
Examples
All four margins are 10px:
H2 {margin: 10px} top and bottom margins are 10px, and the left and right margins are 2% of the width of the parent element:
H2 {margin: 10px 2%} the top margin is 10px, the left and right margins are 2% of the parent element width, and the bottom margin is-10px:
H2 {margin: 10px 2%-10px} Top margin is 10px, right margin is 2% of the parent element width, bottom margin is-10px, and the left margin is set by the browser:
H2 {margin: 10px 2%-10px auto}
Possible value
After reading the above, do you have any further understanding of what margin means? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.