Share
What is the purpose of the `box-sizing` property in CSS?
ReportQuestion
Please briefly explain why you feel this question should be reported.
- A. controls text alignment
- B. Controls element margins
- C. Controls how width and height are calculated
- D. Controls element borders
View Answer
correct Answer ( C )
The box-sizing property in CSS controls how the total width and height of an element are calculated and has two main values : content-box (default) and border-box . With content-box, width and height only apply to the content area, excluding padding and border . With border-box, width and height include padding and border , making layout calculations simpler and more predictable . Using border-box helps avoid unexpected layout shifts
Leave an answer