Q1. What is the margin property in CSS?
Margin creates transparent space outside an element's border, separating it from other elements.
Q2. How can you set margins for different sides?
Use margin-top, margin-right, margin-bottom, margin-left individually, or shorthand margin with 1-4 values.
Q3. What is margin shorthand with four values?
margin: top right bottom left; applies clockwise. Example: margin: 10px 20px 30px 40px;
Q4. What is margin collapse?
When vertical margins of adjacent elements touch, they combine into a single margin equal to the larger one.
Q5. How do you center a block element horizontally?
Set a fixed width and use margin: 0 auto; This applies automatic left and right margins.
