In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to use the margin attribute in css, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
One: how to use the cssmargin attribute
The margin property contains a number of properties, as follows:
Marginleft: indicates that the distance is set to the left inside margin
Margintop: indicates the distance to set the block shape of the element at the top of the head
Marginright: indicates the setting distance from the right element block
Marginbottom: is to set the bottom block distance
II: cssmargin attribute usage tutorial
1.marginleft usage:
The marginleft:50px; syntax is followed by a number or percentage, which represents a distance of 50 pixels from the left element block, or 50% from the element.
To observe the example, we use two boxes:
Margin-left instance www..com
. php-a,.php-b
{float:left;width:150px;height:120px;border:1pxsolid#F00}
. php-b {margin-left:50px}
. php-c {margin-left:50px}
We can change the value and observe the changes, but the effect is the size of the space on the left side of the element.
The use of 2.marginright is just the opposite of marginleft, which is defined as how many pixels the element on the right is apart from.
3.margintop:50px, the syntax followed by a number, means that the upper margin is 50 pixels apart, and it can also be expressed as a percentage.
The usage of 4.marginbottom is similar to that of margintop, and is in the opposite direction.
If we want to use margin:10px to express it up and down, left and right, margin, we should think clockwise. [recommended: detailed explanation of the usage of the margin:auto attribute]
The above is all the content of the article "how to use the margin attribute in css". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.