academy) 100% Solved
Which of the following z-index values will ensure that the fixed position element appears on top
of the relatively positioned element?
div.navigation {
position: fixed;
background-color: Blue;
z-index: ?
}
div.heading {
position: relative;
z-index: ?
} Correct Ans-2 and 1, respectively.
When offset properties are specified, how will the following property affect the positioning of
the div?
div.container {
position: static;
} Correct Ans-The property will not affect the positioning of the div.
,Where on the page will the div appear?
div.container {
position: absolute;
} Correct Ans-The element will appear in its default position because offset properties have
not been specified.
Which of the following values would place the background image at the bottom left of the div's
background?
div.main {
height: 500px;
width: 500px;
background-image: url("https://www.codecademy.com/images/computer.jpg");
background-repeat: no-repeat;
background-position: ?
} Correct Ans-left bottom
The background-size property accepts two values: cover and contain. What is the difference
between each value? Correct Ans-cover will expand an image to fit its container, whereas
contain will letterbox the image in the container.
, What improvements can be made to the CSS code below, if any?
div.main {
background-image: url("https://www.codecademy.com/images/computer.jpg");
background-repeat: no-repeat;
background-position: right center;
} Correct Ans-Condense all three properties into one by using the background property.
The background image of the div is repeating. Why?
div.main {
height: 500px;
width: 500px;
background-image: url("https://www.codecademy.com/images/computer.jpg");
} Correct Ans-The default behavior of all images is to repeat in the x and y directions.
Which of the following values would stop the background image from repeating?
div.main {
height: 500px;
width: 500px;
background-image: url("https://www.codecademy.com/images/computer.jpg");