If you plan on utilizing absolute positioning, ensure to follow this structure:
#highlight_lose {
width: 550px;
height:550px;
position: absolute;
top: 50%;
left: 50%;
margin: -225px 0 0 -225px;
display: none;
}
Update: remember to include position:relative;
to the main div. Check out the updated fiddle here.
The alignment may seem off due to other elements not being perfectly centered.
UPDATE: As previously mentioned, the smiley appeared off-center due to issues in your code. Ideally, the maze should be contained within a separate division. Nevertheless, I managed to visually center it by adjusting the margins.
Check out the adjusted code here.
To achieve this, make sure your CSS follows this format:
#main {
position: relative;
width: 550px;
height: 550px;
float: left;
margin-left: 220px;
margin-top: 100px;
background: grey;
overflow: hidden;
}
#highlight_win {
width: 550px;
height: 550px;
position: absolute;
top: 50%;
left: 50%;
display: none;
margin: -180px 0 0 -180px;
}
#highlight_lose {
width: 550px;
height:550px;
position: absolute;
top: 50%;
left: 50%;
margin: -180px 0 0 -180px;
display: none;
}