Rendering of HTML in Firefox and Chrome

前端 未结 1 1432
一向
一向 2021-01-03 05:22
相关标签:
1条回答
  • 2021-01-03 05:49

    Chrome rounds all widths to integer pixels. Unless your container width is divisible by 10, this means that the float widths will get rounded so they're not actually 30 and 70 percent of it, and as a result there can be space between them.

    Gecko does layout calculations in fractional pixels, so it can represent the widths much more exactly, and snap to the pixel grid at paint time, avoiding this sort of seaming.

    Your possible solutions are to make sure your container has a width that's a multiple of 10px and to complain to the WebKit team about the round-to-integer-pixels behavior. Or both.

    0 讨论(0)
提交回复
热议问题