Skip to content

Commit

Permalink
Merge pull request #6 from bpd01001/feature/difference-between-css-po…
Browse files Browse the repository at this point in the history
…sitioning-types

Differences between types of CSS positioning
  • Loading branch information
bpd01001 authored Apr 16, 2019
2 parents e1ae4d4 + f23c446 commit 3b56325
Showing 1 changed file with 12 additions and 0 deletions.
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.

0 comments on commit 3b56325

Please sign in to comment.