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

Advertisement

<style>
.container {
position: relative;
height: 200px;
width: 200px;
border: 1px solid black;
}
</style>
<div class=”container”><div class=”overlay”></div></div>

  • .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);
    }
  • .overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);
    }
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment


Share via
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Send this to a friend