You can do this, but only if the parent doesn't have a position: relative or absolute property on it. So if you remove the position: absolute from the first div, it'll work as expected.