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

后端 未结 5 2250
梦毁少年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:03

    Well, for one thing you don't know the display size for every device that could access your site. Most will probably have full-size displays (800 x 600 or likely larger), but some will be wide aspect (e.g. 1440 x 900) and some could be mobile devices.

    Allowing each device to layout the elements of your page(s) based on rules -- e.g. Float, margin, padding -- means that each device can optimize the content for its own display.

提交回复
热议问题