2

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*/
}
m00t13
  • 65
  • 1
  • 8

1 Answers1

2

This should do the trick

.a {
  position: absolute;
  top: 50px;
  bottom: 50px;
  left: 50px;
  right: 50px;
  border: 1px solid black;
}
Luca Putzu
  • 1,438
  • 18
  • 24