-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added completed question to CSS folder
- Loading branch information
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
...fference-between-a-relative-fixed-absolute-and-statically-positioned-element.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CSS ELEMENT POSITIONING TYPES | ||
|
||
There are four main options when positioning an element in CSS. These include the following: | ||
|
||
Static: This is the default in CSS and simply means that the element will flow onto the page as expected as it represents the normal behavior of the element. | ||
|
||
Relative: This means the element is positioned relative to its normal position. 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. | ||
|
||
Fixed: This keeps the element in exactly the same place even when the page is scrolled. Since a fixed position element is positioned relative to the browser window itself, it stays constant. | ||
|
||
Absolute: This allows you to place any page element exactly where you want it using the positioning attributes top, left, bottom. and right to set the location. These values will be relative to the next parent element with relative (or absolute) positioning. If there is no such parent, it will default all the way back up to the <html> element itself meaning it will be placed relative to the page itself. It is important to note that absolute positioning elements removes them from the flow of elements on the page,therefore limiting the flexibility of your layout if they are overused. | ||
|