Add more info about position:relative and absolute (#21871)

* Add more info about position:relative and absolute

* Fixed formatting and typos
pull/29194/head^2
Ece 2018-11-16 12:39:51 +03:00 committed by Manish Giri
parent edb0555999
commit 4758090219
1 changed files with 3 additions and 0 deletions

View File

@ -12,6 +12,9 @@ The position property specifies the type of positioning method used for an eleme
.fixed { position: fixed; }
.absolute { position: absolute; }
```
Elements can be literally positioned by getting `top`, `right`, `bottom` and `left` values with the `position` property. Relative positioning will position the element according to the viewport while absolute positioning will position the element according to the parent element with the `position:relative` property.
It's important to know that an element with `position:relative` property will still preserve the space it takes at its original position when it is moved, however, an element with `position:absolute` property will not.
### More Information: