Lab 4 Questions and Answers:

Q: What is the CSS box model?
A: The CSS box model is a box that wraps around HTML elements which includes margins, borders, padding, and content. The box model provides an organization and spacing between HTML elements.

Q: What is the difference between margin and padding?
A: Margin is the area around an element that is outside the border. Margin is transparent.
Padding is the area around an element that is inside the border. Padding color will be changed by changing the background color of the element.

Q: How is an HTML element height and width determined?
A: An HTML element height and width determined by setting the content area by adding the padding, borders, and margins.
The total width = width + left and right padding + left and right border + left and right margin
The total height = height + top and bottom padding + top and bottom border + top and bottom margin

Q: Explain this CSS property: padding:25px 50px;
A: Set the padding (the area around the element inside the border) to 25 pixels for top and bottom and 50 pixels for left and right.

Q: What is the difference between a border and an outline?
A: A border surrounds the padding and content. An outline is a line drawn around the elements (outside of the borders). This causes the elements to be more visible. Border and outline properties can be changed.