Before you go into that Front-End Web Developer interview, make sure you’ve got your CSS Margin and Padding facts down.
Q: Which is closer to the content, margin or padding?
A: Padding is closer to the content
Q: What is the order of the Margin and Padding CSS shorthand syntax?
A: Top, Right, Bottom, Left
Hint: The order is clockwise
Q: How do you set the margin-top and margin-bottom values of a purely inline element?
A: You can’t. Inline elements can only have left and right margins.
Q: True or False: Margin and Padding values can be set in percentages.
Q: When you see the the following, what is the web developer likely trying to do? margin: 0 auto
A: Center an element
Q: Which is furthest away from the content: Margin or Border?
Q: Can Margin and Padding values be expressed in inches?
Q: If you wanted more of an element’s background-color to show, which value would you increase, Margin or Padding?
A: Padding. The Margin is outside of the background color.
Q: Do Margins of inline-block boxes collapse?
Q: When specifying a margin value as a percentage, what is that number a percentage of?
A: It is calculated with respect to the width of the generated box’s containing block.