safari rounding down on subpixel calculations

后端 未结 6 1626
小鲜肉
小鲜肉 2020-12-31 08:47

i have a container that takes up 829px on a row, and has a background-image of the same size.

i have a div within that container that calculates its width based on t

6条回答
  •  猫巷女王i
    2020-12-31 09:35

    I've recently encountered this issue using the whilst using the Bootstrap framework. After trawling the net I found this link http://cruft.io/posts/percentage-calculations-in-ie/ and did some device testing. iOS7 Safari seems to round down to the nearest whole number, whilst iOS8 (Which has subpixel rendering on by default) seems to round up slightly to a max. of 15 decimal places. This also seems to be the same on OSX 10.10 (Yosemite)

    As Nils K mentions in his/her answer, either use a pixel width layout, or try to adapt the layout to make sure it's wide/narrow enough to fit a whole pixel into the space

提交回复
热议问题