Difference between static and relative positioning

2019-01-06 09:11发布

In CSS, what is the difference between static (default) positioning and relative positioning?

7条回答
一纸荒年 Trace。
2楼-- · 2019-01-06 10:10

You can see a simple overview here: W3School

Also, if I recall correctly, when declaring an element relative, it will by default stay in the same place as it otherwise should, but you gain the ability to absolutely position elements inside it relatively to this element, which I've found very useful in the past.

查看更多
登录 后发表回答