Relation between dp - sp and PX

前端 未结 4 1660
悲哀的现实
悲哀的现实 2021-02-04 03:45

I am not asking what is the difference between dp,sp and px.

I am designing a website based on google\'s new material design, all the measurements are in dp (for grid)

4条回答
  •  时光取名叫无心
    2021-02-04 04:35

    I think the answer is going to be:

    1px = 1dp = 1sp on any average monitor or mobile device.

    How did I come up with this?

    Because a pixel is a pixel, for andriod dp and sp are used because they are used for native apps which have to scale and the dpi of each screen is different based on device. For desktops all of this is same, off course the website has to be compatible/responsive for mobile devices but since the website loads in a browser, some additional media quires (based on guidelines) will do the job.

    If anybody has some other logical conclusion, please share

提交回复
热议问题