CSS - Percentages or Pixels?

前端 未结 9 779
梦如初夏
梦如初夏 2020-12-04 21:54

I have been using CSS for many years now, and I have always been a \'percentage\' kind of guy, as in I always define heights and widths using percentages as opposed to pixel

9条回答
  •  北荒
    北荒 (楼主)
    2020-12-04 22:26

    There is obviously no right or wrong. Its rather a matter of fluidity.

    It's easier to position objects relative to each other with pixels and to control exact height and width.

    Scaling objects is on other hand easier with percentages. 50% of the window width will always be half of the window with no matter the screen size.

提交回复
热议问题