当使用“视口高度/ vh”时, CSS中是否包含“浏览器书签栏”共计? [英] When using "Viewport Height/vh" in CSS does it include the "browser bookmark bar" in the total?

查看:382
本文介绍了当使用“视口高度/ vh”时, CSS中是否包含“浏览器书签栏”共计?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Chrome中,书签栏通过Command + Shift + b禁用。我是否应该始终在禁用此功能的网站上进行测试,以使浏览器真正成为 100%?还是启用此功能实际上使 vh 95%成为可能?

In Chrome, the bookmarks bar is disabled with command+shift+b. Should I always be testing sites with this disabled for the browser to truly be "100%"? Or does having this enabled actually make the "vh 95%" for example?

推荐答案

vh使用视口的大小。因此,如果打开书签栏,则视口高度将变小。类似于调整窗口大小并减小高度。

vh uses the size of the viewport. So if you have the bookmarks bar open, then your viewport height is going to be smaller. Would be similar to just resizing your window and make the height smaller.

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


视口百分比长度
相对于初始包含块的大小。更改初始包含块的高度或宽度时,将对其进行相应缩放。但是,当根元素上的溢出值是auto时,将假定不存在任何滚动条。请注意,初始包含块的大小受视口中滚动条的影响。

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# contains-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.

这篇关于当使用“视口高度/ vh”时, CSS中是否包含“浏览器书签栏”共计?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆