Frequently Asked Questions
Q: What is the CSS box model?
The CSS box model is a box that wraps around every HTML element. It contains margins, borders and paddings.
Q: What is the difference between margin and padding?
- Padding is the space between the content and the border.
- Margin is the space outside the border.
Q: How is an HTML element height and width determined?
An HTML element's width and height is determined by the values given to the 'height:' and 'width:' properties. This is done through CSS, or within the tag of the element.
Q: Explain this CSS property: padding:25px 50px;
The CSS property, 'padding:25px 50px' specifies that the top and bottom padding of the element will be 25px, and the right and left padding will be 50px.
Q: What is the difference between a border and an outline?
The difference between a border and an outline is that an outline,
- Always goes around all the sides, you can't specify particular sides
- Is not a part of the box model, so it won't effect the position of the element or adjacent elements