Is there a way to detect if the browser has subpixel precision?

后端 未结 4 384
失恋的感觉
失恋的感觉 2021-01-31 14:36

Is there a way to detect if the browser has subpixel precision for elements ?

IE9, unlike any of the other major browsers, has subpixel precision for its elements (an el

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-31 15:41

    You could create an odd-sized container and drop two 50% width elements in it, and find out whether they've been split 50:50 or not.

    See http://jsfiddle.net/alnitak/jzrQ6/

    It returns false on Chrome 22.0.1229.79 on MacOS X 10.8.2, and true on Firefox 15.0.1. I don't have MSIE to test it with.

提交回复
热议问题