Relative Positioning
Relative Position: Relative positioning is a CSS technique that allows an element to be adjusted from its normal position. The syntax for relative positioning is position: relative;
. When you set the top
, right
, bottom
, and left
properties of an element with relative positioning, it moves from its original location. However, it’s important to note that other elements on the page will not fill the gap left by the moved element.
Syntax:
position: relative;
Difference between relative , absolute and fixed position in CSS
CSS positioning is a fundamental concept in web design and development. It allows us to control the layout of elements on a webpage. This article will tell you the differences between relative, absolute, and fixed positioning in CSS.