0

From this site, I learned that this way can center an element. But why? What is the sequence of the elements calculating the position? How does it exactly work? Which rule has higher priority to another? What is the exact meaning of "bounding box"?

.Absolute-Center {
    margin: auto;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    width: 100px;//exact width
    height: 100px;//exact height
}
Cœur
  • 37,241
  • 25
  • 195
  • 267
Light
  • 474
  • 5
  • 15
  • The link you provided gives a good breakdown of what is happening in the "Explanation" section. – Hidden Hobbes May 01 '15 at 07:07
  • 2
    Here - http://stackoverflow.com/questions/29261595/why-does-position-absolute-left-0-right-0-width-xypx-margin-0-auto-ac/29261683#29261683 – Paulie_D May 01 '15 at 07:15

0 Answers0