本文介绍了Chrome开发者工具窗口尺寸不一致的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您打开Chrome开发者工具,并调整窗口大小时,右上角会显示一个小白色框,告诉您窗口尺寸调整时的大小。我已在下面的屏幕截图中用一个大的绿色箭头标记它。

When you have the Chrome developer tools open, and you resize the window, a small white box appears in the top right corner telling you the dimensions of the window as you resize it. I've marked it with a big green arrow in the screenshot below.

这是一个非常有用的工具,但我注意到,经常值是意外和不一致与其他元素的宽度。例如,当我在下面截图,Chrome说窗口宽度是419px。但如果我点击 html 元素,其宽度应该是100%,Chrome告诉我宽度为404px。这让我很困惑。为什么他们不同?这是Chrome中的错误吗?

This is a very useful tool, but I've noticed that frequently the values are unexpected and inconsistent with the widths of other elements. For example, when I took the screenshot below, Chrome says the window width is 419px. But if I click the html elements, whose width should be 100%, Chrome tells me its width is 404px. This is confusing to me. Why are they different? Is this a bug in Chrome?

推荐答案

这包括垂直滚动条的宽度。
尝试删除滚动条,然后检查。它将完全匹配。

That's including the vertical scroll bar's width. Try removing the scroll bar and then check. It will match exactly.

这篇关于Chrome开发者工具窗口尺寸不一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 17:34