开发者

Chrome css percentage

开发者 https://www.devze.com 2023-04-01 03:26 出处:网络
The problem is simple, webkit (or at least chrome) handle some percentage value badly. For example if I have an overall div with a width of 450px, if I had it two child with a width value of 7.117% a

The problem is simple, webkit (or at least chrome) handle some percentage value badly.

For example if I have an overall div with a width of 450px, if I had it two child with a width value of 7.117% and 7.118%, the output will be two div with a respective width of 31px and 32px. (Fiddle of a test case)

Or a calculus shows that the calculated width value of both div is (in theory) above 32px. The results are 32.0265 and 32.031. So that doesn't appear to be a subpixel problem as rounding down both value is rounding them to 32.

I was 开发者_开发技巧wondering if there were any workaround/best practice or else to deal with it.


Updating chrome fixed the issue. Best practice: update your software.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号