In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to use margin in html5". In daily operation, I believe many people have doubts about how to use margin in html5. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "how to use margin in html5". Next, please follow the editor to study!
In html5, margin is used to refer to the "outer edge", and this attribute can also be used to set all the outer margin properties of an element, which can have 1 to 4 values, respectively, to set the values of four outer margins. The syntax is "margin: top outer margin, right outer margin, lower outer margin, left outer margin;".
The operating environment of this tutorial: windows10 system, HTML5 version, Dell G3 computer.
Which edge does margin refer to in html5
The margin shorthand property sets all the outer margins properties in a declaration. This property can have 1 to 4 values.
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.
Note: negative values are allowed.
Example 1
Margin:10px 5px 15px 20px
The upper outer margin is 10px.
The right outer margin is 5px
The lower outer margin is 15px
The left margin is 20px.
Example 2
Margin:10px 5px 15px
The upper outer margin is 10px.
The right margin and the left margin are 5px
The lower outer margin is 15px
Example 3
Margin:10px 5px
The upper margin and the lower margin are 10px
The right margin and the left margin are 5px
Example 4
Margin:10px
All four outer margins are 10px
Possible values for this property:
The auto browser calculates the outer margin.
Length specifies the outer margin value in specific units, such as pixels, centimeters, and so on. The default value is 0px.
Specifies the outer margin as a percentage of the width of the containing element.
Inherit states that outer margins should be inherited from the parent element.
At this point, the study on "how to use margin in html5" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.