Positioning elements is something we spend a lot of our time on when building sites and applications, so having a good understanding of how to place an element on a layout is crucial, especially when an element can have different positions depending on the available space.
Let's see what positioning is all about.
The position
CSS property defines the location of an element.
There are five keyword values for the position
property: static
, absolute
, relative
, fixed
, and sticky
.
This is the default value of the position
property. The element stays in the flow of the document and appears in the actual location where it's located in the markup.