Adjust the distance between the text and the border in the DIV block
If you like to use DIV blocks for web page layout, there will always be some DIV blocks used to put text content. The distance between the default DIV block text content and the border is usually glued together, causing visual Uncomfortable, web designers usually use the padding property of CSS to adjust the distance between the text in the DIV block and the border, which is commonly known as the inner margin. Through the adjustment of the inner margin, the text in our web page and the DIV block border are adjusted can pull out a gap, look more comfortable, let's take a look at the CSS of padding attribute basic grammar, and then applied to the sample seen tangible results. CSS padding property syntax
Practical example of adjusting the distance between the text and the border in the DIV block
This is the text in the DIV block, and the padding is set to 0px.
</div>
<div style="border:1px blue solid; padding:10px; ">
This is the text in the DIV block, and the padding is set to 10px.
</div>
<div style="border:1px blue solid; padding:20px; ">
This is the text in the DIV block, and the padding is set to 20px.
</div>
Post a Comment
0 Comments