CSS Positioning Explained By Building An Ice Cream Sundae
Kevin Kononenko
1.3K32

Without specifying top, right, bottom, or left, an absolutely positioned element will not sit in the top left corner of its parent element. It will sit in the top left corner of the first ancestor element that has anything but position: static. In general, it will sit in the top left corner of the <html> element. To easily control this behavior, give the parent element position: relative (which acts as static with no further positioning rules).

Show your support

Clapping shows how much you appreciated Josiah Rooney’s story.