Positioned Layout
Default is static
Inset¶
<=>
margin: auto
¶
[[Margin#margin: auto
in positioned layout]]
- centres the element both horizontally and vertically
Position vs margin¶
Absolute
- ????top: 0 vs margin-top: auto;
margin > top
position: sticky
¶
- only stick while their container/parent is in view
- the parent doesn't have to be within sticky
- eg: parent with
margin: 100rem 0
can horizontally stick too!
top: 10px
means that the sticking point is 10px from the top
![[sticky-exercise-1-demo.mp4]]
[!Answer]-
Last update:
2023-04-24