LinkedIn CSS Skill Assessment Quiz Answers

Given this code, which CSS declaration of .overlay will span the entire width and height of its container? Given this code, which CSS declaration of .overlay will span the entire width and height of its container?

Latest Update on 2nd June, 2022 by Certification Course Answers

Given this code, which CSS declaration of .overlay will span the entire width and height of its container? Given this code, which CSS declaration of .overlay will span the entire width and height of its container?

<style>
.container {
  position: relative;
  height: 200px;
  width: 200px;
  border: 1px solid black;
}

</style>
  <div class="container"><div class="overlay"></div></div><style>

 .container {
   position: relative;
   height: 200px;
   width: 200px;
   border: 1px solid black;
 }

</style>
  • [ ]
.overlay {
  position: static;
  top: 200px;
  bottom: 200px;
  right: 200px;
  left: 200px;
  background-color: rgba(0, 0, 0, 0.5);
}
  • [ ]
.overlay {
  position: absolute;
  top: 200px;
  bottom: 200px;
  right: 200px;
  left: 200px;
  background-color: rgba(0, 0, 0, 0.5);
}
  • [ ]
.overlay {
  position: static;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5);
}
  • [X]
.overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

Correct Answer:

  • [X]
.overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

Latest Updates

No posts found in this category.