Position Property
Used for positioning a element with different methods
Types of position value:
- Static
- Relative
- Fixed
- Absolute
- Sticky
Position Property
Used for positioning a element with different methods
Types of position value:
Static
Example
postion: static;
This is a Static Element
Relative
Examples
postion: relative; left: 10px
This element is 10px shifted from left
postion: relative; top: 10px
This element is 10px shifted from top
postion: relative; right: 10px
This element is 10px shifted from right
Fixed
Example
position: fixed; right: 0; bottom: 10%;
This element has the fixed property
Absolute
Example
position: absolute; width: 200px; top: 30px; left: 300px;
This element has postion property set to absolute.
Sticky
Example
position: sticky;
This is a sticky element