The Web Just This Site

NM Web Tutorials

Layout: Padding

Similar to Margins, but I think would best be demonstrated with text:

CSS

What The Code Does

#padded_area {
display:block;
height:100px;
width:180px;
padding:10px 20px 30px 40px
}

Content doesn't touch the edge because of the padding.

Dimensions are fairly important with all your divisions, here is how it works:

1st number: adds to the top.
2nd number: adds to the right.
3rd number: adds to the bottom.
4th number: adds to the left.

Key word being “add”, when you add padding to your display: block;, it will make the division bigger.