nODZ Posted November 7, 2018 Report Posted November 7, 2018 (edited) So i'm doing stef's css course right now , and i love it , but there is one question that makes no sense to me. In chapter 4 The Box Model , lesson 7 calculate width / question 3 there is a question that goes like this : Please update the margin on this div , so that it will fit into 400px. the code is <div style="width: 300px; padding: 10px; border: 0px; margin:">. So on margin i added 15px , the way i see it width is 300px + padding 40 (10x4) so i thought we need 60px (4x15) to make it 400px , but the answer says 40px is the correct answer , dont get why? Edited November 7, 2018 by nODZ
Andrea Posted November 8, 2018 Report Posted November 8, 2018 The pudding is inside the width, so you would add a right and left margin of 50px each.
Andrea Posted November 8, 2018 Report Posted November 8, 2018 ...also, even if you needed to include tja padding, you would only consider the right and left, not top and bottom. And I jut see the answer should be 40..... why is that? (It’s been a while for me, what am I overlooking?) 1
nODZ Posted November 8, 2018 Author Report Posted November 8, 2018 okay I see what I did wrong, so it's the width that he is looking,(i thought total) !so 300 + 10 padding on left and right = 320, so we add the margin of 40px to left and right (total 80px). 320+80=400width tnx for reply btw
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now