Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

12
  • Thanks a lot Alejandro I'd like to ask you regarding the first part that, you mentioned, as it was written in every documentation: the element is positioned relative to its first positioned (not static) ancestor element this means for me the container is the first positioned ancestor in this case. Why the grey-box is not positioned to its? Why it isn't in the top left corner of the container? Commented Feb 19, 2019 at 21:18
  • Hi, the ancestor of box-grey isn't container, it's box-green. box-green is postioned top: -105px; and left: 105px;, if you remove this propesrties you'll see that box-grey it's just under box-green. That's because the ancestor it's the element that is just before Regards Commented Feb 19, 2019 at 21:35
  • so but what you are saying is wrong, box-green isn't an ancestor of box-grey, it's a sibling element. The ancestor is not the before element Commented Feb 19, 2019 at 21:43
  • That's ture, srry. But, the propertie position works well with the siblings, so i supposed that the ancestor were in the top. Commented Feb 19, 2019 at 21:50
  • 1
    @MontyX no! he's not right. It's false. like I told you, you have to set top/left properties to see the desired result (top:0;left:0) .. and the ancestor is not the previous element Commented Feb 19, 2019 at 21:54