With box-sizing: content-box, an element has width 200px, padding 20px and a 5px border on each side. What is its total rendered width?
Correct answer
A. 250px
14 views
A. 250px
14 views
In the content-box model, padding and border are added to the width: 200 + (2 × 20) + (2 × 5) = 250px. With box-sizing: border-box it would stay 200px.
Asked in: NTS, Web Developer Interviews
Not sure why the answer is A? Ask here and get an explanation.