These are chat archives for codefellows/sea-f1-TAs/Zach
Hey Zach, In the week 4 quiz there was this problem:
I have a <div> that has the following styles applied to it
border: 2px solid #a7a7a;
How wide (in px) is my div?
I answered 384 which came back as wrong. given the box model I believe this is the correct calculation:
Why is this wrong?
I checked that link and it gives the size of the box in pixels. The question was how wide is the div not the box.
Here are 2 sites I referenced and their answers:
The total width of an element should be calculated like this:
Total element width = width + left padding + right padding + left border + right border + left margin + right margin
According to the box model, the total width of an element can be calculated using the following formula:
margin-right + border-right + padding-right + width + padding-left + border-left + margin-left
Both site explicitly say that the element width includes the padding. For now I still maintain the correct answer is 384px.