This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11596|Reply: 0

[HTML/HTML5] HTML margin and inner margin padding are explained in detail

[Copy link]
Posted on 10/30/2014 4:21:55 PM | | |

The padding property defines the space between the element's border and the element's contents.

This property can take 4 values:

•If a value is specified, such as div {padding: 50px} - all four sides of padding are 50 px.
•If two values are specified, such as div {padding: 50px 10px} - the top and bottom padding is 50 px, and the left and right padding is 10 px.
•If you specify three values, such as div {padding: 50px 10px 20px} - the upper and lower padding is 50 px, the left and right padding is 10 px, and the lower padding is 20 px.
•If you specify four values, such as div {padding: 50px 10px 20px 30px} - the upper padding is 50 px, the right padding is 10 px, the lower padding is 20 px, and the left padding is 30 px.


DIV CSS margin refers to the CSS attribute word margin, margin is the margin that sets the four sides of the object, with no background color and no color.
1. Margin syntax
Margin:10px
The value of margin is a number + html unit, and it can also be auto (automatic, adaptive)
2. Application structure
Div{margin:10px}
Set the div object to 10px spacing
3. Margin description
margin is the distance between the outer edge of the object and the epitaxial edge.
There are three situations in which the value of margin can be a positive integer and a negative integer and add a unit such as PX pixels (margin-left: 20px); auto can be used as an automatic attribute (margin-left: auto auto); It can be a percentage (%) value (margin-left: 3%).
Margin extension (set the four-sided spacing attribute word separately)
margin-left object left left margin (margin-left:5px; Left Extension Distance 5px)
margin-right The right margin of the object (margin-right:5px; Right extension distance 5px)
margin-top object (margin-top:5px; Upper Epitaxial Distance 5px)
margin-bottom object (margin-bottom:5px; Lower epitaxial distance 5px)




Previous:How do I remove the underscore of a hyperlink in html?
Next:Watch elementary school students play LOL and kill everything in seconds! (Latest Player Original)
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com