Positioning in CSS
The position property determines how an element should be positioned on the page. The most common values are:
static: The element is positioned according to the normal flow of the page. Example:
css
Copy code
div {
position: static;
}
relative: The element is positioned relative to its normal position on the page. Example:
css
img {
position: relative;
top: 20px;
left: 10px;
}
absolute: The element is positioned relative to its nearest positioned ancestor. Example:
css
#menu {
position: absolute;
top: 0;
right: 0;
}
No comments:
Post a Comment