• 0 Posts
  • 3 Comments
Joined 2 年前
cake
Cake day: 2023年6月12日

help-circle
  • BleakBluets@lemmy.worldtoProgrammer Humor@programming.devCSS Gardening
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    1
    ·
    edit-2
    26 天前

    It’s so the position: absolute for .leaves works relative to .tree. The implication is that .leaves is a descendant of .tree.

    position: absolute looks for the nearest ancestor with a set position in order to determine its own positioning context. Otherwise the absolute positioning would basically be relative to the viewport. If the position: relative was missing, the leaves would be against the bottom edge of the image.

    source

    edit: I mean .leaves, not .branch