Reputation: 65
I have a wrapper that takes up the whole screen and I want to make another div to be centered inside it and all its sides be equidistant from the wrapper.
css:
#wrapper {
width:100%;
height:100%;
top:0;
left:0;
position:absolute;
}
#inner_div {
/*centered, sides equidistant from wrapper*/
}
Upvotes: 2
Views: 138
Reputation: 1456
This should do the trick
.a {
position: absolute;
top: 50px;
bottom: 50px;
left: 50px;
right: 50px;
border: 1px solid black;
}
Upvotes: 2