When we are in front-end page layout, CSS internal and external margin properties of the role is extremely important, only the full use of CSS padding and margin properties are CSS padding and margin style attributes to complete the design of good-looking front-end page. So before I wrote "What are the CSS margin properties?" What are the uses? "Has given you a detailed description of CSS margin properties of the use of the specific method. This article will continue to introduce to you
css padding padding propertiesThe specific use of the method!
Below we have detailed code examples for everyone to explain.
Here is a section of the CSS padding property using the sample code as follows:
<! DOCTYPE html>
The above code effects are as follows:
First we need to know that padding represents the distance between an element and its bounding rectangle. Then we look at the div block P1, we set the text in the padding 10px style attributes, also let the text and the four-sided red border distance is increased by 10 pixels. Then we add padding:20 30px to P2, the style attribute, which indicates that the upper and lower margins of the text segment are 20px, and the left and right margins are 30px.
We continue to see the P3 added in the padding:10px 5px 15px 20px, the style of the property, here is the text of the upper padding is 10px, the right padding is 5px, the bottom padding is 15px, the left padding is 20px.
Here the upper and lower left and right margin settings, can also be taken out to write, such as Padding-top, Padding-left, Padding-bottom, Padding-right.
Note: CSS style padding padding can not set negative values!