Loading Please Wait...
The CSS position property sets how an element is positioned in a document. The top, right, bottom, and left properties determine the final location of positioned elements.
The element is positioned according to the normal flow of the document. The top, right, bottom, left, and z-index properties have no effect. This is the default value.
.position-static{
position: static;
}
The element is positioned according to the normal flow of the document.
Setting the top, right, bottom, and left properties of a relatively-positioned element will cause it to be adjusted away from its normal position. Other content will not be adjusted to fit into any gap left by the element.
.position-relative{
position: relative;
top: 50px;
left: 50px;
}
The element is positioned relative to the viewport, which means it always stays in the same place even if the page is scrolled.
The element is removed from the normal document flow, and no space is created for the element in the page layout.
.position-fixed{
position: fixed;
bottom: 50px;
right: 50px;
}
The element is positioned relative to the nearest positioned ancestor (body in case of no ancestor).
The element is removed from the normal document flow, and no space is created for the element in the page layout.
.position-absolute{
position: absolute;
top: 50px;
right: 50px;
}
The element is positioned based on the user's scroll position.
A sticky element toggles between relative and fixed, depending on the scroll position. It is positioned relative until a given offset position is met in the viewport - then it "sticks" in place (like position fixed).
The element is positioned according to the normal flow of the document, and then offset relative to its nearest scrolling ancestor
.position-sticky{
position: sticky;
top: 50px;
}
How you feel about this blog:
Share this blog on:
If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com
Contact UsWe are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..
Copyright ©
, Lynxsia IT Solutions, All rights reserved