PrepAway - Latest Free Exam Questions & Answers

How should you complete the relevant code?

HOTSPOT
You are creating a custom CSS3 style.
You have the following requirements to complete the style:
Box1 has a red outline.
Box1 contains box2, and box2 must remain inside box1
Box2 must have a green to black gradient.
Box2 must be surrounded by white space.
The style resembles the following diagram:

You need to add the CSS3 code to the styles.
How should you complete the relevant code? (To answer, select the appropriate code
segment in each drop-down list in the answer area.)

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:

One Comment on “How should you complete the relevant code?

  1. Jacob says:

    Heres my explanation for anyone confused, as I was when I first saw this question:

    Box1’s answer is the first option because it is the only option that sets a border. (border: 1px solid #f00) The other options all contain styling elements but none of them actually CREATE the border like in option 1.

    Box 2’s answer is the first option because we are creating a linear-gradient that goes from green to black from the top to the bottom. Therefore to-bottom is the correct directional choice. Also note that Linear-Gradients go up/down/left/right/diagonally whereas Radial-Gradients are defined by their center. (http://www.w3schools.com/css/css3_gradients.asp)

    Box 3’s answer is the second option because Margin is the outer space of an element, whereas Padding is the inner space of an element. Since we are trying to space the outer space of the element we choose margin rather than padding. (http://stackoverflow.com/questions/2189452/when-to-use-margin-vs-padding-in-css)




    1



    0

Leave a Reply