Reputation: 31
how to make the layer is shown in the center of the browser window entirely.
Here is a description of styles for a layer:
#centerLayer {
position: absolute;
width: 1280px;
height: 1500px;
left: 50%;
top: 50%;
margin-left: -150px;
margin-top: -100px;
background-color: #e9cb99;
background-image: url("bg.jpg");
background: url("bg.jpg") #e9cb99;
padding: 10px;
overflow: auto;
}
Upvotes: 0
Views: 36
Reputation: 746
Try this: http://jsfiddle.net/xBRq9/54/
#centerLayer {
position: absolute;
top:0;
bottom:0;
left:0;
right:0;
margin:0 auto;
margin-top:100px;
margin-botton:100px;
width:50%;
height:50%;
background-color:#333;
}
Upvotes: 0
Reputation: 22663
#centerLayer {
position: absolute;
width: 1280px;
height: 1500px;
left: 50%;
top: 50%;
margin-left:-640px;/*** width/2 ***/
margin-top:-750px;/*** height/2 ***/
background-color:#e9cb99;
background-image:url("bg.jpg");
background: url("bg.jpg") #e9cb99;
padding: 10px;
overflow: auto;
}
Upvotes: 1