Margin and paddingMarginThe blank space surrounding the external borders of an area is called margin.A style sheet can define the margins of <BODY>,<P>,<DIV> and <SPAN> sections. His width can be expressed in pixel or percentage. For example:
BODY { margin: 2%; }
P { margin: 20px; }
Try this:
PaddingThe blank space surrounding the content of an area is called padding.A style sheet can define the padding of <P>,<DIV> and <SPAN> sections, and <TD> (table cells). His width can be expressed in pixel or percentage. For example:
DIV.pad { padding: 2%; }
P { padding: 20px; }
A section without padding look like this...
A DIV section without padding...
A section with padding look like this: A DIV section with padding...
Size settingsThe width of padding and margin can be declared using:
Next page : how to set width and height of a section of the page. |