http://jsfiddle.net/AndyMP/T5pX2/
.block {
position: relative;
margin: 25px;
width: 300px;
height: 300px;
border: 1px solid black;
}
.overlay {
width: 300px;
height: 300px;
background: yellow;
opacity: 0;
}
<div class="block">
<div class="overlay">
</div>
</div>
Best Solution
What you have at the moment is not an overlay it's just one div inside another.
To make it an overlay you need to use
position:absolute
as follows:JSfiddle Demo
CSS