Lab 4 Q/A

What is the CSS box model?

The CSS box model is a box that wraps around every HTML element consisting of margins, borders, padding and content in that order.

What is the difference between margin and padding?

The difference between margin and padding is that margin clears an area outside the border and the padding clears an area around the content.

How is an HTML element height and width determined?

An HTML element's height and width is determined by the following calculation:

For width: (width) + (left + right padding) + (left + right border) + (left + right margin) = width.

For height: (height) + (top + bottom padding) + (top + bottom border) + (top + bottom margin) = height.

Explain this CSS property: padding: 25px 50px;

If the padding property has two values, then the top and bottom padding are 25px and the right and left padding are 50px.

What is the difference between a border and an outline?

A border wraps around elements while an outline is a line that is drawn around elements outside the borders.