
As you can see that the margin is the most outer layer of the model. Then comes the border followed by padding and finally the content it self. The height and width of the content can also be manipulated like older styles of XHTML. You can also set individual sides such as margin-left or padding-right. Manipulating these properties sets the total width and height of the element.
calculate total width:
Total element width = width + left padding + right padding + left border + right border + left margin + right margin
Calculate total height:
Total element height = height + top padding + bottom padding + top border + bottom border + top margin + bottom margin
No comments:
Post a Comment