5 Types of CSS Positions for Better Layouts🔥 Open this🧵

This is the default value for all HTML elements’ positioning. In this positioning, elements are positioned in the normal flow of the document.
Applying the top, right, bottom, or left properties and z-index to a statically positioned element will have no effect.
In the below example, position: static; property is applied only to the second box, and it doesn’t differ the layout of the second box because static is the default value.
With position: relative; elements follow their normal document flow but can be shifted from their original position, using the top, right, bottom and left properties.
With this property, surrounding elements won’t be affected, but there will be space where the element would have been in the static position.
With position: absolute; elements do not follow the normal flow of the document. The element is positioned relative to its closet positioned ancestor (an element with the positioning of relative, absolute, fixed, or sticky).
And if there is no ancestor, then the element will be positioned relative to the viewport.
shefali.dev/css-positions/
github.com/WebdevShefali/…
Thanks for checking out.
If you find this helpful, then consider:
❤️Like
✅Follow me @Shefali__J for more content like this.
🔁Repost the below quote👇
x.com/Shefali__J/sta…





