Why use percentage value for div's width in CSS?

前端 未结 8 1889
无人及你
无人及你 2021-02-13 11:09

I am reading articles about css. I found out that many of writers suggest to use % value for div\'s width or height.

I am using pixels all the time.

Why should I

8条回答
  •  走了就别回头了
    2021-02-13 11:49

    I find web sites that don't fit the screen, either leaving white space (which can be considerable) round the edge of the content, or falling off the side with a scrollbar (or, worse, falling off the side withOUT a scrollber!) intensely annoying.

    I write my pages to fit the screen, regardless of how large that screen is.

提交回复
热议问题