Questions
Questions

4510_COMP_SCI_X_0019 Quiz 2

Multiple choice

Which of the following CSS blocks results in this blue div:

Options
A.div { width: 200px; height: 150px; padding: 50px; margin: 50px; border: 2px solid blue; background-color: CornflowerBlue; }
B.div { width: 150px; height: 100px; padding: 50px; margin: 50px; border: 2px solid blue; background-color: CornflowerBlue; }
C.div { width: 100px; height: 50px; padding: 50px; margin: 50px; border: 2px solid blue; background-color: CornflowerBlue; box-sizing: border-box }
D.div { width: 96px; height: 46px; padding: 50px; margin: 50px; border: 2px solid blue; background-color: CornflowerBlue; }
E.div { width: 200px; height: 150px; padding: 50px; margin: 50px; border: 2px solid blue; background-color: CornflowerBlue; box-sizing: border-box }
F.div { width: 150px; height: 100px; padding: 50px; margin: 50px; border: 2px solid blue; background-color: CornflowerBlue; box-sizing: border-box }
Question Image
View Explanation

View Explanation

Verified Answer
Please login to view
Step-by-Step Analysis
We start by restating the task: identify which CSS block produces a blue div matching the given dimensions and styling. Option 1 declares: div { width: 200px; height: 150px; padding: 50px; margin: 50px; border: 2px solid blue; background-color: CornflowerBlue; } With the default box-sizing: content-box, padding adds to the width and height. The total rendered box would be: outer width = 200px + 2*50px padding + 2*2px border = 200 + 100 + 4 = 304px, outer height = 150px + 2*50px padding + 2*2px border = 150 + 100 + 4 = 254px. That does not match the target 200x150 plus padding ap......Login to view full explanation

Log in for full answers

We've collected over 50,000 authentic exam questions and detailed explanations from around the globe. Log in now and get instant access to the answers!

More Practical Tools for Students Powered by AI Study Helper

Join us and instantly unlock extensive past papers & exclusive solutions to get a head start on your studies!