gpt4 book ai didi

css - 在 CSS 中使用 "Viewport Height/vh"时,它是否包括总数中的 "browser bookmark bar"?

转载 作者:行者123 更新时间:2023-12-01 22:11:57 24 4
gpt4 key购买 nike

在 Chrome 中,可以使用 command+shift+b 禁用书签栏。我是否应该始终在禁用此功能的情况下测试网站,以使浏览器真正成为“100%”?还是启用此功能实际上会使“vh 95%”?

最佳答案

vh 使用视口(viewport)的大小。因此,如果您打开了书签栏,那么您的视口(viewport)高度将会变小。类似于仅调整窗口大小并减小高度。

https://www.w3.org/TR/css-values-3/#viewport-relative-lengths

The viewport-percentage lengths are relative to the size of the initial containing block. When the height or width of the initial containing block is changed, they are scaled accordingly. However, when the value of overflow on the root element is auto, any scroll bars are assumed not to exist. Note that the initial containing block’s size is affected by the presence of scrollbars on the viewport.

https://www.w3.org/TR/CSS21/visudet.html#containing-block-details

The containing block in which the root element lives is a rectangle called the initial containing block. For continuous media, it has the dimensions of the viewport and is anchored at the canvas origin; it is the page area for paged media.

关于css - 在 CSS 中使用 "Viewport Height/vh"时,它是否包括总数中的 "browser bookmark bar"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47396067/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com