Why shouldn't I use position:absolute for positioning everything?

后端 未结 5 2242
梦毁少年i
梦毁少年i 2020-12-03 07:20

This question is asked by one of my students and I want to enlighten him with an example:

\"Why we should not create site layout by Dreamweaver\'s A

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-03 08:13

    OK, so let's say you absolutely position everything. What happens when #mainContent has one paragraph on one page, and two paragraphs on the second page. Where do you place #footer pixel-wise? What happens if the user increases their font size?

    Dreamweaver provides the button because absolute positioning is sometimes useful. That doesn't make it always useful.

提交回复
热议问题