CSS Position

ยท

2 min read

The position property is used to set the position of a element. Through the help of position property we can place a element behind another element also we can create animated effect on those elements.

We can position a element through the top, bottom, left and right properties. If we want to use these properties so first of all we have to set the position of the element. We can set the property of element as static, absolute, relative and fixed.

Here are the different type of CSS positons.

๐Ÿ. ๐‚๐’๐’ ๐’๐ญ๐š๐ญ๐ข๐œ ๐๐จ๐ฌ๐ข๐ญ๐ข๐จ๐ง

๐Ÿ. ๐‚๐’๐’ ๐…๐ข๐ฑ๐ž๐ ๐๐จ๐ฌ๐ข๐ญ๐ข๐จ๐ง

๐Ÿ‘. ๐‚๐’๐’ ๐€๐›๐ฌ๐จ๐ฅ๐ฎ๐ญ๐ž ๐๐จ๐ฌ๐ข๐ญ๐ข๐จ๐ง

๐Ÿ’. ๐‚๐’๐’ ๐‘๐ž๐ฅ๐š๐ญ๐ข๐ฏ๐ž ๐๐จ๐ฌ๐ข๐ญ๐ข๐จ๐ง

๐Ÿ. ๐‚๐’๐’ ๐’๐ญ๐š๐ญ๐ข๐œ ๐๐จ๐ฌ๐ข๐ญ๐ข๐จ๐ง

This position is by default for the html elements.It always positions a html element according to the flow of the page.It is not affected by top, bottom, left and right properties.

๐Ÿ. ๐‚๐’๐’ ๐…๐ข๐ฑ๐ž๐ ๐๐จ๐ฌ๐ข๐ญ๐ข๐จ๐ง

This property is used to fix the element on the browser.After fixing element on the browser,if we scroll at that time element will be fixed at it's position.

๐Ÿ‘. ๐‚๐’๐’ ๐€๐›๐ฌ๐จ๐ฅ๐ฎ๐ญ๐ž ๐๐จ๐ฌ๐ข๐ญ๐ข๐จ๐ง

This positioning is used to position an element relative to the first parent element that has a position other than static.With the help of absolute position we can place an element anywhere on the page.

๐Ÿ’. ๐‚๐’๐’ ๐‘๐ž๐ฅ๐š๐ญ๐ข๐ฏ๐ž ๐๐จ๐ฌ๐ข๐ญ๐ข๐จ๐ง

This position is used to set the element relative to it's normal position.

ย